Documentation ¶
Index ¶
- Constants
- func Command(args ...force.Expression) (force.Action, error)
- func Copy(args ...interface{}) (force.Action, error)
- func ExecuteSCP(log force.Logger, client *ssh.Client, cmd scp.Command) error
- func KeysEqual(ak, bk ssh.PublicKey) bool
- func Scope() (force.Group, error)
- func Session(hosts interface{}, actions ...Action) (force.Action, error)
- type Action
- type Client
- type CommandAction
- func (s *CommandAction) BindClient(client *Client, env []Env) (Action, error)
- func (s *CommandAction) Eval(ctx force.ExecutionContext) (interface{}, error)
- func (s *CommandAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
- func (s *CommandAction) String() string
- func (s *CommandAction) Type() interface{}
- type Config
- type CopyAction
- func (s *CopyAction) BindClient(client *Client, _ []Env) (Action, error)
- func (s *CopyAction) Eval(ctx force.ExecutionContext) (interface{}, error)
- func (s *CopyAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
- func (s *CopyAction) String() string
- func (s *CopyAction) Type() interface{}
- type Dialer
- type Env
- type HostSequence
- type Hosts
- type KeyPair
- type Namespace
- type NewSession
- type Plugin
- type SessionAction
- type Setup
- type Target
Constants ¶
const ( KeySetup = "Setup" KeyConfig = "Config" )
const Key = Namespace("ssh")
Key is a name of the plugin variable
Variables ¶
This section is empty.
Functions ¶
func Command ¶
func Command(args ...force.Expression) (force.Action, error)
Command runs SSH command on a remote server
func ExecuteSCP ¶
ExecuteSCP runs remote scp command(shellCmd) on the remote server and runs local scp handler using SCP Command
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps ssh client and optional proxy client
type CommandAction ¶
type CommandAction struct {
// contains filtered or unexported fields
}
func (*CommandAction) BindClient ¶
func (s *CommandAction) BindClient(client *Client, env []Env) (Action, error)
func (*CommandAction) Eval ¶
func (s *CommandAction) Eval(ctx force.ExecutionContext) (interface{}, error)
Eval evaluates variable and returns string
func (*CommandAction) MarshalCode ¶
func (s *CommandAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals the action into code representation
func (*CommandAction) String ¶
func (s *CommandAction) String() string
func (*CommandAction) Type ¶
func (s *CommandAction) Type() interface{}
type Config ¶
type Config struct { // User is a linux login to try User string // KnownHostsFile is a list of hosts or certificates KnownHostsFile string // KeyPairs is a list of key pairs KeyPairs []KeyPair // ProxyJump is a proxy jump address (similar to ssh -J) ProxyJump string }
Config is an ssh client configuration
func (*Config) CheckAndSetDefaults ¶
func (cfg *Config) CheckAndSetDefaults() (*ssh.ClientConfig, error)
CheckAndSetDefaults checks and sets default values
type CopyAction ¶
type CopyAction struct {
// contains filtered or unexported fields
}
func (*CopyAction) BindClient ¶
func (s *CopyAction) BindClient(client *Client, _ []Env) (Action, error)
func (*CopyAction) Eval ¶
func (s *CopyAction) Eval(ctx force.ExecutionContext) (interface{}, error)
func (*CopyAction) MarshalCode ¶
func (s *CopyAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals the action into code representation
func (*CopyAction) String ¶
func (s *CopyAction) String() string
func (*CopyAction) Type ¶
func (s *CopyAction) Type() interface{}
type HostSequence ¶
type HostSequence struct {
// contains filtered or unexported fields
}
HostSequence executes a series of commands in a sequence
func (*HostSequence) Eval ¶
func (s *HostSequence) Eval(ctx force.ExecutionContext) (interface{}, error)
Eval runs actions in sequence on a single host
func (*HostSequence) MarshalCode ¶
func (p *HostSequence) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals action into code representation
func (*HostSequence) Type ¶
func (s *HostSequence) Type() interface{}
Type returns type of the sequence
type Hosts ¶
type Hosts struct { // Hosts is a list of hosts to target Hosts []string Env []Env // ProxyJump is a proxy jump address (similar to ssh -J) ProxyJump string }
Hosts enumerates hosts and helps to set environment
type KeyPair ¶
type Namespace ¶
type Namespace string
Namespace is a wrapper around string to namespace a variable in the context
type NewSession ¶
type NewSession struct { }
NewSession
func (*NewSession) NewInstance ¶
func (n *NewSession) NewInstance(group force.Group) (force.Group, interface{})
NewInstance returns a new instance of a function with a new lexical scope
type Plugin ¶
type Plugin struct {
// contains filtered or unexported fields
}
Plugin is a new logging plugin
type SessionAction ¶
type SessionAction struct {
// contains filtered or unexported fields
}
SessionAction runs actions in a sequence, if the action fails, next actions are not run
func (*SessionAction) Eval ¶
func (s *SessionAction) Eval(ctx force.ExecutionContext) (interface{}, error)
Eval runs actions in sequence using the passed scope
func (*SessionAction) MarshalCode ¶
func (p *SessionAction) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals action into code representation
func (*SessionAction) Type ¶
func (s *SessionAction) Type() interface{}
type Setup ¶
type Setup struct {
// contains filtered or unexported fields
}
Setup creates new instances of plugins
func (*Setup) Eval ¶
func (n *Setup) Eval(ctx force.ExecutionContext) (interface{}, error)
Eval sets up logging plugin for the instance group
func (*Setup) MarshalCode ¶
func (n *Setup) MarshalCode(ctx force.ExecutionContext) ([]byte, error)
MarshalCode marshals plugin setup to code
func (*Setup) NewInstance ¶
NewInstance returns a new instance of a plugin bound to group