Documentation ¶
Index ¶
- func CheckingCloudInstance(opt libs.Options)
- func ClearAllInstances(opt libs.Options)
- func CommandBuilder(options libs.Options) string
- func InitCloud(options libs.Options, targets []string)
- func InitCloudSetup(opt libs.Options)
- func PrepareTarget(target string, options libs.Options) string
- func StringPrompt(label string, alt string) string
- type Client
- func Dial(network, addr string, config *ssh.ClientConfig) (*Client, error)
- func DialWithKey(addr, user, keyfile string) (*Client, error)
- func DialWithKeyString(addr, user, keyContent string) (*Client, error)
- func DialWithKeyWithPassphrase(addr, user, keyfile string, passphrase string) (*Client, error)
- func DialWithPasswd(addr, user, passwd string) (*Client, error)
- type CloudRunner
- func GetAllInstances(opt libs.Options) (instances []CloudRunner)
- func GetClouds(options libs.Options) []CloudRunner
- func SetupProvider(opt libs.Options, providerConfig provider.ConfigProvider) CloudRunner
- func ValidateProvider(opt libs.Options, providerConfig provider.ConfigProvider) (CloudRunner, error)
- func (c *CloudRunner) CheckingDone() error
- func (c *CloudRunner) CloudMoreParams()
- func (c *CloudRunner) CopyTarget() error
- func (c *CloudRunner) CopyWorkflow() error
- func (c *CloudRunner) CreateInstance(target string) error
- func (c *CloudRunner) CreateUIReport()
- func (c *CloudRunner) DBNewTarget()
- func (c *CloudRunner) DBRuntimeUpdate()
- func (c *CloudRunner) DeleteInstanceConfig()
- func (c *CloudRunner) ErrorWriteInstanceConfig() error
- func (c *CloudRunner) HealthCheck() bool
- func (c *CloudRunner) InitSSHClient() (*Client, error)
- func (c *CloudRunner) IsPanic() bool
- func (c *CloudRunner) IsRunning() bool
- func (c *CloudRunner) PostRunLocal() error
- func (c *CloudRunner) PreRunLocal() error
- func (c *CloudRunner) PreRunRemote() error
- func (c *CloudRunner) Prepare()
- func (c *CloudRunner) PrepareInput()
- func (c *CloudRunner) RetryCommand(cmd string, timeoutRaw ...string)
- func (c *CloudRunner) RetryCommandWithExcludeString(cmd string, excludeString string, timeoutRaw ...string) string
- func (c *CloudRunner) RetryCommandWithExpectString(cmd string, expectString string, timeoutRaw ...string) string
- func (c *CloudRunner) RunScan() error
- func (c *CloudRunner) SSHExec(command string) (string, error)
- func (c *CloudRunner) Scan(target string) error
- func (c *CloudRunner) StartScan() error
- func (c *CloudRunner) SyncResult() error
- func (c *CloudRunner) WriteInstanceConfig() error
- type TerminalConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckingCloudInstance ¶
func ClearAllInstances ¶
func CommandBuilder ¶
CommandBuilder build core command from API
func InitCloudSetup ¶
func PrepareTarget ¶
PrepareTarget change the target file destination
func StringPrompt ¶
StringPrompt asks for a string value using the label
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func Dial ¶
func Dial(network, addr string, config *ssh.ClientConfig) (*Client, error)
Dial starts a client connection to the given SSH server. This is wrap the ssh.Dial
func DialWithKey ¶
DialWithKey starts a client connection to the given SSH server with key authmethod.
func DialWithKeyString ¶
DialWithKeyString starts a client connection to the given SSH server with key authmethod.
func DialWithKeyWithPassphrase ¶
DialWithKeyWithPassphrase same as DialWithKey but with a passphrase to decrypt the private key
func DialWithPasswd ¶
DialWithPasswd starts a client connection to the given SSH server with passwd authmethod.
func (*Client) Shell ¶
func (c *Client) Shell() *remoteShell
Shell create a noninteractive shell on client.
func (*Client) Terminal ¶
func (c *Client) Terminal(config *TerminalConfig) *remoteShell
Terminal create a interactive shell on client.
type CloudRunner ¶
type CloudRunner struct { Opt libs.Options `json:"-"` Provider provider.Provider // for storing in local DB TaskName string `json:"task_name"` TaskType string `json:"task_type"` Input string `json:"input"` RawCommand string `json:"raw_command"` InstanceFile string `json:"instance_file"` // core entry point PublicIP string `json:"public_ip"` DestInstance string `json:"dest_instance"` SshPublicKey string `json:"ssh_public_key"` SshPrivateKey string SSHUser string BasePath string InstanceID string `json:"instance_id"` InstanceName string `json:"instance_name"` IsError bool `json:"is_error"` Target map[string]string `json:"-"` Runner core.Runner `json:"-"` }
func GetAllInstances ¶
func GetAllInstances(opt libs.Options) (instances []CloudRunner)
func GetClouds ¶
func GetClouds(options libs.Options) []CloudRunner
GetClouds prepare clouds object in config file
func SetupProvider ¶
func SetupProvider(opt libs.Options, providerConfig provider.ConfigProvider) CloudRunner
SetupProvider setup new provider
func ValidateProvider ¶
func ValidateProvider(opt libs.Options, providerConfig provider.ConfigProvider) (CloudRunner, error)
ValidateProvider setup new provider
func (*CloudRunner) CheckingDone ¶
func (c *CloudRunner) CheckingDone() error
func (*CloudRunner) CloudMoreParams ¶
func (c *CloudRunner) CloudMoreParams()
func (*CloudRunner) CopyTarget ¶
func (c *CloudRunner) CopyTarget() error
func (*CloudRunner) CopyWorkflow ¶
func (c *CloudRunner) CopyWorkflow() error
func (*CloudRunner) CreateInstance ¶
func (c *CloudRunner) CreateInstance(target string) error
func (*CloudRunner) CreateUIReport ¶
func (c *CloudRunner) CreateUIReport()
func (*CloudRunner) DBNewTarget ¶
func (c *CloudRunner) DBNewTarget()
func (*CloudRunner) DBRuntimeUpdate ¶
func (c *CloudRunner) DBRuntimeUpdate()
func (*CloudRunner) DeleteInstanceConfig ¶
func (c *CloudRunner) DeleteInstanceConfig()
func (*CloudRunner) ErrorWriteInstanceConfig ¶
func (c *CloudRunner) ErrorWriteInstanceConfig() error
func (*CloudRunner) HealthCheck ¶
func (c *CloudRunner) HealthCheck() bool
func (*CloudRunner) InitSSHClient ¶
func (c *CloudRunner) InitSSHClient() (*Client, error)
func (*CloudRunner) IsPanic ¶
func (c *CloudRunner) IsPanic() bool
IsPanic checking if cloud instance has any panic error
func (*CloudRunner) IsRunning ¶
func (c *CloudRunner) IsRunning() bool
IsRunning checking if cloud instance is running or not
func (*CloudRunner) PostRunLocal ¶
func (c *CloudRunner) PostRunLocal() error
func (*CloudRunner) PreRunLocal ¶
func (c *CloudRunner) PreRunLocal() error
func (*CloudRunner) PreRunRemote ¶
func (c *CloudRunner) PreRunRemote() error
func (*CloudRunner) PrepareInput ¶
func (c *CloudRunner) PrepareInput()
func (*CloudRunner) RetryCommand ¶
func (c *CloudRunner) RetryCommand(cmd string, timeoutRaw ...string)
func (*CloudRunner) RetryCommandWithExcludeString ¶
func (c *CloudRunner) RetryCommandWithExcludeString(cmd string, excludeString string, timeoutRaw ...string) string
func (*CloudRunner) RetryCommandWithExpectString ¶
func (c *CloudRunner) RetryCommandWithExpectString(cmd string, expectString string, timeoutRaw ...string) string
func (*CloudRunner) RunScan ¶
func (c *CloudRunner) RunScan() error
func (*CloudRunner) Scan ¶
func (c *CloudRunner) Scan(target string) error
func (*CloudRunner) StartScan ¶
func (c *CloudRunner) StartScan() error
func (*CloudRunner) SyncResult ¶
func (c *CloudRunner) SyncResult() error
func (*CloudRunner) WriteInstanceConfig ¶
func (c *CloudRunner) WriteInstanceConfig() error
type TerminalConfig ¶
type TerminalConfig struct { Term string Height int Weight int Modes ssh.TerminalModes }