cmd

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SSHAddPath = "ssh-add"
View Source
const SSHAgentPath = "ssh-agent"

Variables

View Source
var SSHAgentAuthSockRe = regexp.MustCompile(`SSH_AUTH_SOCK=(.*?);`)

Functions

This section is empty.

Types

type SCP

type SCP struct {
	*process.Executor

	Session *session.Session

	RemoteDst bool
	Dst       string
	RemoteSrc bool
	Src       string
	Preserve  bool
	Recursive bool
	// contains filtered or unexported fields
}

func NewSCP

func NewSCP(sett settings.Settings, sess *session.Session) *SCP

func (*SCP) SCP

func (s *SCP) SCP(ctx context.Context) *SCP

func (*SCP) WithDst

func (s *SCP) WithDst(path string) *SCP

func (*SCP) WithPreserve

func (s *SCP) WithPreserve(preserve bool) *SCP

func (*SCP) WithRecursive

func (s *SCP) WithRecursive(recursive bool) *SCP

func (*SCP) WithRemoteDst

func (s *SCP) WithRemoteDst(path string) *SCP

func (*SCP) WithRemoteSrc

func (s *SCP) WithRemoteSrc(path string) *SCP

func (*SCP) WithSrc

func (s *SCP) WithSrc(path string) *SCP

type SSH

type SSH struct {
	*process.Executor
	Session     *session.Session
	Args        []string
	Env         []string
	CommandName string
	CommandArgs []string

	ExitWhenTunnelFailure bool
	// contains filtered or unexported fields
}

func NewSSH

func NewSSH(sett settings.Settings, sess *session.Session) *SSH

func (*SSH) Cmd

func (s *SSH) Cmd(ctx context.Context) *exec.Cmd

TODO move connection settings from ExecuteCmd

func (*SSH) WithArgs

func (s *SSH) WithArgs(args ...string) *SSH

func (*SSH) WithCommand

func (s *SSH) WithCommand(name string, arg ...string) *SSH

func (*SSH) WithEnv

func (s *SSH) WithEnv(env ...string) *SSH

func (*SSH) WithExitWhenTunnelFailure

func (s *SSH) WithExitWhenTunnelFailure(yes bool) *SSH

type SSHAdd

type SSHAdd struct {
	AgentSettings *session.AgentSettings
	// contains filtered or unexported fields
}

func NewSSHAdd

func NewSSHAdd(sett settings.Settings, sess *session.AgentSettings) *SSHAdd

func (*SSHAdd) AddKeys

func (s *SSHAdd) AddKeys(keys []string) error

func (*SSHAdd) KeyCmd

func (s *SSHAdd) KeyCmd(keyPath string) *exec.Cmd

func (*SSHAdd) ListCmd

func (s *SSHAdd) ListCmd() *exec.Cmd

type SSHAgent

type SSHAgent struct {
	*process.Executor
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(sshSett settings.Settings, agentSettings *session.AgentSettings) *SSHAgent

func (*SSHAgent) Start

func (a *SSHAgent) Start() error

Start runs ssh-agent as a subprocess, gets SSH_AUTH_SOCK path and

func (*SSHAgent) Stop

func (a *SSHAgent) Stop()

func (*SSHAgent) WithAuthSock

func (a *SSHAgent) WithAuthSock(sock string) *SSHAgent

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL