Documentation
¶
Index ¶
- Constants
- type AuthSpec
- type Client
- type CommandResult
- type ConnectionRetrySpec
- type ConnectionRetryState
- type ExecuteSSHContext
- type ExecutionMetadata
- type SSHCommand
- func (c *SSHCommand) Actions() []core.Action
- func (c *SSHCommand) Cancel(ctx core.ExecutionContext) error
- func (c *SSHCommand) Cleanup(ctx core.SetupContext) error
- func (c *SSHCommand) Color() string
- func (c *SSHCommand) Configuration() []configuration.Field
- func (c *SSHCommand) Description() string
- func (c *SSHCommand) Documentation() string
- func (c *SSHCommand) ExampleOutput() map[string]any
- func (c *SSHCommand) Execute(ctx core.ExecutionContext) error
- func (c *SSHCommand) HandleAction(ctx core.ActionContext) error
- func (c *SSHCommand) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
- func (c *SSHCommand) Icon() string
- func (c *SSHCommand) Label() string
- func (c *SSHCommand) Name() string
- func (c *SSHCommand) OutputChannels(configuration any) []core.OutputChannel
- func (c *SSHCommand) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
- func (c *SSHCommand) Setup(ctx core.SetupContext) error
- type SecretKeyRef
- type Spec
Constants ¶
View Source
const AuthMethodPassword = "password"
View Source
const AuthMethodSSHKey = "ssh_key"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthSpec ¶
type AuthSpec struct {
Method string `json:"authMethod" mapstructure:"authMethod"`
PrivateKey SecretKeyRef `json:"privateKey" mapstructure:"privateKey"`
Passphrase SecretKeyRef `json:"passphrase" mapstructure:"passphrase"`
Password SecretKeyRef `json:"password" mapstructure:"password"`
}
type Client ¶
type Client struct {
Host string
Port int
Username string
// For key auth
PrivateKey []byte
Passphrase []byte
// For password auth
Password []byte
// contains filtered or unexported fields
}
Client connects to an SSH server and runs commands. Supports either SSH key or password authentication.
func NewClientKey ¶
func NewClientPassword ¶
func (*Client) ExecuteCommand ¶
type CommandResult ¶
type ConnectionRetrySpec ¶ added in v0.8.0
type ConnectionRetryState ¶ added in v0.8.0
type ConnectionRetryState struct {
Attempt int `json:"attempt" mapstructure:"attempt"` // retries done so far (1 = first retry)
MaxRetries int `json:"maxRetries" mapstructure:"maxRetries"` // max retries from config
IntervalSeconds int `json:"intervalSeconds" mapstructure:"intervalSeconds"` // seconds between attempts
}
type ExecuteSSHContext ¶ added in v0.8.0
type ExecuteSSHContext struct {
// contains filtered or unexported fields
}
type ExecutionMetadata ¶
type ExecutionMetadata struct {
Result *CommandResult `json:"result" mapstructure:"result"`
Host string `json:"host" mapstructure:"host"`
Port int `json:"port" mapstructure:"port"`
User string `json:"user" mapstructure:"user"`
Command string `json:"command" mapstructure:"command"`
WorkingDirectory string `json:"workingDirectory" mapstructure:"workingDirectory"`
Timeout int `json:"timeout" mapstructure:"timeout"`
ConnectionRetry *ConnectionRetrySpec `json:"connectionRetry" mapstructure:"connectionRetry"`
Attempt int `json:"attempt" mapstructure:"attempt"`
MaxRetries int `json:"maxRetries" mapstructure:"maxRetries"`
IntervalSeconds int `json:"intervalSeconds" mapstructure:"intervalSeconds"`
Authentication AuthSpec `json:"authentication" mapstructure:"authentication"`
}
type SSHCommand ¶
type SSHCommand struct{}
func (*SSHCommand) Actions ¶
func (c *SSHCommand) Actions() []core.Action
func (*SSHCommand) Cancel ¶
func (c *SSHCommand) Cancel(ctx core.ExecutionContext) error
func (*SSHCommand) Cleanup ¶
func (c *SSHCommand) Cleanup(ctx core.SetupContext) error
func (*SSHCommand) Color ¶
func (c *SSHCommand) Color() string
func (*SSHCommand) Configuration ¶
func (c *SSHCommand) Configuration() []configuration.Field
func (*SSHCommand) Description ¶
func (c *SSHCommand) Description() string
func (*SSHCommand) Documentation ¶
func (c *SSHCommand) Documentation() string
func (*SSHCommand) ExampleOutput ¶
func (c *SSHCommand) ExampleOutput() map[string]any
func (*SSHCommand) Execute ¶
func (c *SSHCommand) Execute(ctx core.ExecutionContext) error
func (*SSHCommand) HandleAction ¶
func (c *SSHCommand) HandleAction(ctx core.ActionContext) error
func (*SSHCommand) HandleWebhook ¶
func (c *SSHCommand) HandleWebhook(ctx core.WebhookRequestContext) (int, error)
func (*SSHCommand) Icon ¶
func (c *SSHCommand) Icon() string
func (*SSHCommand) Label ¶
func (c *SSHCommand) Label() string
func (*SSHCommand) Name ¶
func (c *SSHCommand) Name() string
func (*SSHCommand) OutputChannels ¶
func (c *SSHCommand) OutputChannels(configuration any) []core.OutputChannel
func (*SSHCommand) ProcessQueueItem ¶
func (c *SSHCommand) ProcessQueueItem(ctx core.ProcessQueueContext) (*uuid.UUID, error)
func (*SSHCommand) Setup ¶
func (c *SSHCommand) Setup(ctx core.SetupContext) error
type SecretKeyRef ¶
type SecretKeyRef struct {
Secret string `json:"secret" mapstructure:"secret"`
Key string `json:"key" mapstructure:"key"`
}
func (SecretKeyRef) IsSet ¶
func (r SecretKeyRef) IsSet() bool
type Spec ¶
type Spec struct {
Host string `json:"host" mapstructure:"host"`
Port int `json:"port" mapstructure:"port"`
User string `json:"username" mapstructure:"username"`
Authentication AuthSpec `json:"authentication" mapstructure:"authentication"`
Command string `json:"command" mapstructure:"command"`
WorkingDirectory string `json:"workingDirectory,omitempty" mapstructure:"workingDirectory"`
Timeout int `json:"timeout" mapstructure:"timeout"`
ConnectionRetry *ConnectionRetrySpec `json:"connectionRetry,omitempty" mapstructure:"connectionRetry"`
}
Click to show internal directories.
Click to hide internal directories.