Documentation
¶
Index ¶
- Variables
- func ExitError(argv []string, res *Result) error
- func NewClientConfig(cfg coretypes.SSHConfig, user string, timeout time.Duration) (*ssh.ClientConfig, error)
- func NodeInfo(ctx context.Context, runner Runner, root string) (*enginetypes.Info, error)
- func ParseEndpoint(endpoint, prefix string) (user, host, addr string, err error)
- func Quote(argv []string) string
- func Reader(sess Session) io.ReadCloser
- func Shell(body string, args ...string) []string
- type Execs
- type FileInfo
- type Files
- type Result
- type Runner
- type Session
- type StartOptions
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrExecNotFound = errors.New("exec not found")
Functions ¶
func NewClientConfig ¶
func NewClientConfig(cfg coretypes.SSHConfig, user string, timeout time.Duration) (*ssh.ClientConfig, error)
NewClientConfig builds the ssh client config core uses for every node it drives over SSH.
func ParseEndpoint ¶
ParseEndpoint splits <prefix>[user@]host[:port] into its ssh user, host and dial address.
func Reader ¶
func Reader(sess Session) io.ReadCloser
Reader streams a running command's stdout and closes the session with it.
Types ¶
type Files ¶
type Files interface {
Open(path string) (io.ReadCloser, error)
Create(path string) (io.WriteCloser, error)
MkdirAll(path string) error
Stat(path string) (*FileInfo, error)
Chown(path string, uid, gid int) error
Chmod(path string, mode os.FileMode) error
Close() error
}
Files is sftp access to the node's filesystem.
type Result ¶
Result is what a finished command left behind.
type Runner ¶
type Runner interface {
Run(ctx context.Context, line string, stdin io.Reader) (*Result, error)
Start(ctx context.Context, line string, opts *StartOptions) (Session, error)
Files(ctx context.Context) (Files, error)
Dial(ctx context.Context, network, addr string) (net.Conn, error)
Ping(ctx context.Context) error
Close() error
}
Runner drives one node over a single SSH connection.
type Session ¶
type Session interface {
Stdin() io.WriteCloser
Stdout() io.ReadCloser
Stderr() io.ReadCloser
Resize(height, width uint) error
Wait() (int, error)
Close() error
}
Session is a command running on the node with its streams attached.
type StartOptions ¶
StartOptions selects the stream shape of a long-running command.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package sshrunnertest is a scripted runner every engine's tests drive a node with.
|
Package sshrunnertest is a scripted runner every engine's tests drive a node with. |
Click to show internal directories.
Click to hide internal directories.