Documentation
¶
Index ¶
- Constants
- Variables
- func CheckLocalPath(path string) (string, error)
- func CreateEmptyTmpFile() (string, error)
- type Agent
- type Check
- type Command
- func (c *Command) Cmd(ctx context.Context)
- func (c *Command) CombinedOutput(ctx context.Context) ([]byte, error)
- func (c *Command) OnCommandStart(fn func())
- func (c *Command) Output(ctx context.Context) ([]byte, []byte, error)
- func (c *Command) Sudo(ctx context.Context)
- func (c *Command) WithEnv(env map[string]string)
- func (c *Command) WithSSHArgs(args ...string)
- func (c *Command) WithTimeout(timeout time.Duration)
- type File
- func (f *File) Download(ctx context.Context, remotePath, dstPath string) error
- func (f *File) DownloadBytes(ctx context.Context, remotePath string) ([]byte, error)
- func (f *File) Upload(ctx context.Context, srcPath, remotePath string) error
- func (f *File) UploadBytes(ctx context.Context, data []byte, remotePath string) error
- type KubeProxy
- type ReverseTunnel
- type ReverseTunnelChecker
- type ReverseTunnelKiller
- type Tunnel
- type UploadScript
- func (u *UploadScript) Execute(ctx context.Context) (stdout []byte, err error)
- func (u *UploadScript) ExecuteBundle(ctx context.Context, parentDir, bundleDir string) (stdout []byte, err error)
- func (u *UploadScript) Sudo()
- func (u *UploadScript) WithCleanupAfterExec(doCleanup bool)
- func (u *UploadScript) WithEnvs(envs map[string]string)
- func (u *UploadScript) WithStdoutHandler(handler func(string))
- func (u *UploadScript) WithTimeout(timeout time.Duration)
Constants ¶
View Source
const DefaultLocalAPIPort = 22322
Variables ¶
View Source
var ErrBashibleTimeout = errors.New("Timeout bashible step running")
Functions ¶
func CheckLocalPath ¶
CheckLocalPath see if file exists and determine if it is a directory. Error is returned if file is not exists.
func CreateEmptyTmpFile ¶
Types ¶
type Agent ¶
type Agent struct { AgentSettings *session.AgentSettings Agent *cmd.SSHAgent }
func NewAgent ¶
func NewAgent(sess *session.AgentSettings) *Agent
type Command ¶
type Command struct { *process.Executor Session *session.Session Name string Args []string Env []string SSHArgs []string // contains filtered or unexported fields }
func (*Command) CombinedOutput ¶
func (*Command) OnCommandStart ¶
func (c *Command) OnCommandStart(fn func())
func (*Command) WithSSHArgs ¶
func (*Command) WithTimeout ¶
type File ¶
func (*File) DownloadBytes ¶
Download remote file and returns its content as an array of bytes.
type KubeProxy ¶
type KubeProxy struct { Session *session.Session KubeProxyPort string LocalPort string // contains filtered or unexported fields }
func NewKubeProxy ¶
type ReverseTunnel ¶
type ReverseTunnel struct { Session *session.Session Address string // contains filtered or unexported fields }
func NewReverseTunnel ¶
func NewReverseTunnel(sess *session.Session, address string) *ReverseTunnel
func (*ReverseTunnel) StartHealthMonitor ¶
func (t *ReverseTunnel) StartHealthMonitor(ctx context.Context, checker ReverseTunnelChecker, killer ReverseTunnelKiller)
func (*ReverseTunnel) Stop ¶
func (t *ReverseTunnel) Stop()
func (*ReverseTunnel) String ¶
func (t *ReverseTunnel) String() string
func (*ReverseTunnel) Up ¶
func (t *ReverseTunnel) Up() error
type ReverseTunnelChecker ¶
type ReverseTunnelKiller ¶
type Tunnel ¶
type Tunnel struct { Session *session.Session Type string // Remote or Local Address string // contains filtered or unexported fields }
func (*Tunnel) HealthMonitor ¶
type UploadScript ¶
type UploadScript struct { Session *session.Session ScriptPath string Args []string // contains filtered or unexported fields }
func NewUploadScript ¶
func NewUploadScript(sess *session.Session, scriptPath string, args ...string) *UploadScript
func (*UploadScript) Execute ¶
func (u *UploadScript) Execute(ctx context.Context) (stdout []byte, err error)
func (*UploadScript) ExecuteBundle ¶
func (*UploadScript) Sudo ¶
func (u *UploadScript) Sudo()
func (*UploadScript) WithCleanupAfterExec ¶
func (u *UploadScript) WithCleanupAfterExec(doCleanup bool)
WithCleanupAfterExec option tells if ssh executor should delete uploaded script after execution was attempted or not. It does not care if script was executed successfully of failed.
func (*UploadScript) WithEnvs ¶
func (u *UploadScript) WithEnvs(envs map[string]string)
func (*UploadScript) WithStdoutHandler ¶
func (u *UploadScript) WithStdoutHandler(handler func(string))
func (*UploadScript) WithTimeout ¶
func (u *UploadScript) WithTimeout(timeout time.Duration)
Click to show internal directories.
Click to hide internal directories.