Documentation ¶
Index ¶
- func WithPrefix(prefix string, remoter *Remoter) *pathPrefix
- type Remoter
- func (r *Remoter) Close() error
- func (r *Remoter) Get(waitCtx context.Context, remote string, local string) error
- func (r *Remoter) Output(waitCtx context.Context, cmd string) (string, []byte, error)
- func (r *Remoter) Put(waitCtx context.Context, local string, remote string) error
- func (r *Remoter) Run(waitCtx context.Context, cmds []string, stdout io.Writer, stderr io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithPrefix ¶
WithPrefix return the PathPrefix
Types ¶
type Remoter ¶
type Remoter struct { Host string User string Port string // contains filtered or unexported fields }
func Dial ¶
Dial remote machine sshConf["host"] = "1.1.1.1" sshConf["auth"] = []ssh.AuthMethod sshConf["port"] = sshConf["user"] =
func (*Remoter) Output ¶
Output run a command, and return stdout && stderr Also return the executed command, when cmd is compose by prefix, we need know cmd in caller
func (*Remoter) Run ¶
func (r *Remoter) Run(waitCtx context.Context, cmds []string, stdout io.Writer, stderr io.Writer) error
Run commands command not terminate by '\n' , commands not include "exit" If a middle command fails, the next command will run ignore error diff with Output() method, all command share one same stdout
Click to show internal directories.
Click to hide internal directories.