Documentation
¶
Index ¶
- func PublicKeyFromStr(keyStr string) ssh.AuthMethod
- type LibCommand
- func (sc *LibCommand) Close() fail.Error
- func (sc *LibCommand) Display() string
- func (sc *LibCommand) NewRunWithTimeout(ctx context.Context, outs outputs.Enum, timeout time.Duration) (int, string, string, fail.Error)
- func (sc *LibCommand) Output() (_ []byte, ferr error)
- func (sc *LibCommand) RunWithTimeout(ctx context.Context, outs outputs.Enum, timeout time.Duration) (int, string, string, fail.Error)
- func (sc *LibCommand) String() string
- type Profile
- func (sconf *Profile) Command(cmdString string) (*LibCommand, fail.Error)
- func (sconf *Profile) Config() (sshapi.Config, fail.Error)
- func (sconf *Profile) CopyWithTimeout(ctx context.Context, remotePath string, localPath string, isUpload bool, ...) (int, string, string, fail.Error)
- func (sconf *Profile) CreatePersistentTunneling() fail.Error
- func (sconf *Profile) CreateTunneling(ctx context.Context) (*sshtunnel.SSHTunnel, *Profile, error)
- func (sconf *Profile) Enter(ctx context.Context, username string, _ string) (ferr fail.Error)
- func (sconf *Profile) GetGatewayConfig(num uint) (sshapi.Config, fail.Error)
- func (sconf *Profile) GetHostname() (string, fail.Error)
- func (sconf *Profile) GetIPAddress() (string, fail.Error)
- func (sconf *Profile) GetLocalHost() (string, fail.Error)
- func (sconf *Profile) GetLocalPort() (uint, fail.Error)
- func (sconf *Profile) GetPort() (uint, fail.Error)
- func (sconf *Profile) GetPrimaryGatewayConfig() (sshapi.Config, fail.Error)
- func (sconf *Profile) GetPrivateKey() (string, fail.Error)
- func (sconf *Profile) GetSecondaryGatewayConfig() (sshapi.Config, fail.Error)
- func (sconf *Profile) GetUser() (string, fail.Error)
- func (sconf *Profile) HasGateways() (bool, fail.Error)
- func (sconf *Profile) NewCommand(_ context.Context, cmdString string) (sshapi.Command, fail.Error)
- func (sconf *Profile) NewSudoCommand(_ context.Context, cmdString string) (sshapi.Command, fail.Error)
- func (sconf *Profile) SudoCommand(cmdString string) (*LibCommand, fail.Error)
- func (sconf *Profile) WaitServerReady(ctx context.Context, phase string, timeout time.Duration) (out string, err fail.Error)
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LibCommand ¶
type LibCommand struct {
// contains filtered or unexported fields
}
LibCommand defines an SSH command
func (*LibCommand) Close ¶
func (sc *LibCommand) Close() fail.Error
Close this function exists only to provide compatibility with previous SSH api
func (*LibCommand) NewRunWithTimeout ¶
func (sc *LibCommand) NewRunWithTimeout(ctx context.Context, outs outputs.Enum, timeout time.Duration) (int, string, string, fail.Error)
NewRunWithTimeout ...
func (*LibCommand) Output ¶
func (sc *LibCommand) Output() (_ []byte, ferr error)
Output runs the command and returns its standard output. Any returned error will usually be of type *ExitError. If c.Stderr was nil, Output populates ExitError.Stderr.
func (*LibCommand) RunWithTimeout ¶
func (sc *LibCommand) RunWithTimeout(ctx context.Context, outs outputs.Enum, timeout time.Duration) (int, string, string, fail.Error)
RunWithTimeout ...
func (*LibCommand) String ¶
func (sc *LibCommand) String() string
type Profile ¶
type Profile struct { Hostname string `json:"hostname"` IPAddress string `json:"ip_address"` Port int `json:"port"` User string `json:"user"` PrivateKey string `json:"private_key"` LocalPort int `json:"-"` LocalHost string `json:"local_host"` GatewayConfig sshapi.Config `json:"primary_gateway_config,omitempty"` SecondaryGatewayConfig sshapi.Config `json:"secondary_gateway_config,omitempty"` }
Profile helper to manage ssh session
func NewProfile ¶
func (*Profile) Command ¶
func (sconf *Profile) Command(cmdString string) (*LibCommand, fail.Error)
Command returns the cmd struct to execute cmdString remotely
func (*Profile) CopyWithTimeout ¶
func (sconf *Profile) CopyWithTimeout(ctx context.Context, remotePath string, localPath string, isUpload bool, timeout time.Duration) (int, string, string, fail.Error)
CopyWithTimeout ...
func (*Profile) CreatePersistentTunneling ¶
func (*Profile) CreateTunneling ¶
CreateTunneling ...
func (*Profile) GetGatewayConfig ¶
func (*Profile) GetPrimaryGatewayConfig ¶
func (*Profile) GetSecondaryGatewayConfig ¶
func (*Profile) NewCommand ¶
NewCommand returns the cmd struct to execute cmdString remotely
func (*Profile) NewSudoCommand ¶
func (sconf *Profile) NewSudoCommand(_ context.Context, cmdString string) (sshapi.Command, fail.Error)
NewSudoCommand returns the cmd struct to execute cmdString remotely. Command is executed with sudo
func (*Profile) SudoCommand ¶
func (sconf *Profile) SudoCommand(cmdString string) (*LibCommand, fail.Error)
SudoCommand returns the cmd struct to execute cmdString remotely. Command is executed with sudo