Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultHeight = 40 DefaultWidth = 80 )
Variables ¶
This section is empty.
Functions ¶
func MarshalED25519PrivateKey ¶ added in v0.0.452
func MarshalED25519PrivateKey(key ed25519.PrivateKey, comment string) []byte
// stolen from `mikesmitty`, thanks, you are a mikesmitty and a scholar
Types ¶
type Client ¶
type Client struct {
Addr string
User string
Dial func(ctx context.Context, network, addr string) (net.Conn, error)
PrivateKey, Certificate string
Client *ssh.Client
// contains filtered or unexported fields
}
func (*Client) SFTP ¶ added in v0.4.87
func (c *Client) SFTP(ctx context.Context, target SessionTarget, opts ...sftp.ClientOption) (*sftp.Client, error)
SFTP opens an SFTP client against the session target: a container's filesystem, or the machine's own. The target has to be set on the session carrying the subsystem, and sftp.NewClient opens a session of its own with nothing set on it -- so the session is built here, where the target already gets set for shells.
Closing the returned client closes that session with it.
type SessionIO ¶ added in v0.0.504
type SessionIO struct {
Stdin io.Reader
Stdout io.WriteCloser
Stderr io.WriteCloser
AllocPTY bool
TermEnv string
}
type SessionTarget ¶ added in v0.4.83
type SessionTarget struct {
// Container names the container to run in. When empty, the machine decides
// where the session lands.
Container string
// Machine runs the session in the machine's own namespace instead of in a
// container. It is mutually exclusive with Container.
Machine bool
}
SessionTarget selects where a session runs on the remote machine.
Click to show internal directories.
Click to hide internal directories.