Documentation
¶
Index ¶
- Constants
- Variables
- func LoadConfigBytes(names ...string) ([]byte, error)
- func LoadSshConfig() error
- func LoadYamlConfig(filename string) error
- func PrepareConfig() error
- func RegisterLifecycle(lifecycle Lifecycle)
- func SetLogger(logger Logger)
- func WalkInterface(v reflect.Value, walked bool, solver ValueSolver) error
- type Client
- type CommonLifecycle
- func (d *CommonLifecycle) OnStderr(node *Node, line []byte) error
- func (d *CommonLifecycle) OnStdout(node *Node, line []byte) error
- func (d *CommonLifecycle) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
- func (d *CommonLifecycle) PostNewSession(node *Node, session *ssh.Session) error
- func (d *CommonLifecycle) PostSSHDial(node *Node, client *ssh.Client) error
- func (d *CommonLifecycle) PostSessionWait(node *Node) error
- func (d *CommonLifecycle) PostShell(node *Node, stdin io.WriteCloser) error
- func (d *CommonLifecycle) Priority() int
- type CustomTemplate
- type Lifecycle
- type LifecycleAgent
- type LifecycleCallback
- type LifecycleComposite
- func (l *LifecycleComposite) OnStderr(node *Node, line []byte) error
- func (l *LifecycleComposite) OnStdout(node *Node, line []byte) error
- func (l *LifecycleComposite) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
- func (l *LifecycleComposite) PostNewSession(node *Node, session *ssh.Session) error
- func (l *LifecycleComposite) PostSSHDial(node *Node, client *ssh.Client) error
- func (l *LifecycleComposite) PostSessionWait(node *Node) error
- func (l *LifecycleComposite) PostShell(node *Node, stdin io.WriteCloser) error
- func (l *LifecycleComposite) Priority() int
- type LifecycleIO
- type LifecyclePassword
- type LifecyclePem
- type LifecycleQueue
- type LifecycleTerminal
- type Logger
- type Node
- type NodeCallbackShell
- type NodeCp
- type NodeExec
- type TemplateNode
- type ValueSolver
Constants ¶
View Source
const ( TypeStr = "str" TypeParam = "param" )
Variables ¶
View Source
var (
DefaultCiphers = []string{
"aes128-ctr",
"aes192-ctr",
"aes256-ctr",
"aes128-gcm@openssh.com",
"chacha20-poly1305@openssh.com",
"arcfour256",
"arcfour128",
"arcfour",
"aes128-cbc",
"3des-cbc",
"blowfish-cbc",
"cast128-cbc",
"aes192-cbc",
"aes256-cbc",
}
)
View Source
var (
ErrorInterrupt = errors.New("interrupt")
)
Functions ¶
func LoadConfigBytes ¶ added in v1.2.0
func LoadSshConfig ¶ added in v1.2.0
func LoadSshConfig() error
func LoadYamlConfig ¶ added in v1.4.0
func PrepareConfig ¶ added in v1.4.0
func PrepareConfig() error
func RegisterLifecycle ¶ added in v1.2.0
func RegisterLifecycle(lifecycle Lifecycle)
func WalkInterface ¶ added in v1.4.0
func WalkInterface(v reflect.Value, walked bool, solver ValueSolver) error
Types ¶
type CommonLifecycle ¶ added in v1.2.0
type CommonLifecycle struct { Name string PriorityFunc func() int PostInitClientConfigFunc func(node *Node, clientConfig *ssh.ClientConfig) error PostSSHDialFunc func(node *Node, client *ssh.Client) error PostNewSessionFunc func(node *Node, session *ssh.Session) error PostShellFunc func(node *Node, stdin io.WriteCloser) error OnStdoutFunc func(node *Node, line []byte) error OnStderrFunc func(node *Node, line []byte) error PostSessionWaitFunc func(node *Node) error }
CommonLifecycle is used to build Lifecycle quickly
func (*CommonLifecycle) OnStderr ¶ added in v1.2.0
func (d *CommonLifecycle) OnStderr(node *Node, line []byte) error
func (*CommonLifecycle) OnStdout ¶ added in v1.2.0
func (d *CommonLifecycle) OnStdout(node *Node, line []byte) error
func (*CommonLifecycle) PostInitClientConfig ¶ added in v1.2.0
func (d *CommonLifecycle) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
func (*CommonLifecycle) PostNewSession ¶ added in v1.2.0
func (d *CommonLifecycle) PostNewSession(node *Node, session *ssh.Session) error
func (*CommonLifecycle) PostSSHDial ¶ added in v1.2.0
func (d *CommonLifecycle) PostSSHDial(node *Node, client *ssh.Client) error
func (*CommonLifecycle) PostSessionWait ¶ added in v1.2.0
func (d *CommonLifecycle) PostSessionWait(node *Node) error
func (*CommonLifecycle) PostShell ¶ added in v1.2.0
func (d *CommonLifecycle) PostShell(node *Node, stdin io.WriteCloser) error
func (*CommonLifecycle) Priority ¶ added in v1.2.0
func (d *CommonLifecycle) Priority() int
type CustomTemplate ¶ added in v1.4.0
type CustomTemplate struct {
Templates []*TemplateNode
}
func ParseSshwTemplate ¶ added in v1.4.0
func ParseSshwTemplate(src string) *CustomTemplate
func (*CustomTemplate) Execute ¶ added in v1.4.0
func (c *CustomTemplate) Execute() string
type Lifecycle ¶ added in v1.2.0
type Lifecycle interface { PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error PostSSHDial(node *Node, client *ssh.Client) error PostNewSession(node *Node, session *ssh.Session) error PostShell(node *Node, stdin io.WriteCloser) error OnStdout(node *Node, line []byte) error OnStderr(node *Node, line []byte) error PostSessionWait(node *Node) error Priority() int }
type LifecycleAgent ¶ added in v1.2.0
type LifecycleAgent struct {
// contains filtered or unexported fields
}
func (*LifecycleAgent) PostInitClientConfig ¶ added in v1.2.0
func (l *LifecycleAgent) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
func (*LifecycleAgent) PostNewSession ¶ added in v1.2.0
func (l *LifecycleAgent) PostNewSession(node *Node, session *ssh.Session) error
func (*LifecycleAgent) PostSSHDial ¶ added in v1.2.0
func (l *LifecycleAgent) PostSSHDial(node *Node, client *ssh.Client) error
func (*LifecycleAgent) Priority ¶ added in v1.2.0
func (l *LifecycleAgent) Priority() int
type LifecycleCallback ¶ added in v1.2.0
func (*LifecycleCallback) OnStdout ¶ added in v1.2.0
func (l *LifecycleCallback) OnStdout(node *Node, line []byte) error
func (*LifecycleCallback) PostShell ¶ added in v1.2.0
func (l *LifecycleCallback) PostShell(node *Node, stdin io.WriteCloser) error
type LifecycleComposite ¶ added in v1.2.0
type LifecycleComposite struct {
// contains filtered or unexported fields
}
func (*LifecycleComposite) OnStderr ¶ added in v1.2.0
func (l *LifecycleComposite) OnStderr(node *Node, line []byte) error
func (*LifecycleComposite) OnStdout ¶ added in v1.2.0
func (l *LifecycleComposite) OnStdout(node *Node, line []byte) error
func (*LifecycleComposite) PostInitClientConfig ¶ added in v1.2.0
func (l *LifecycleComposite) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
func (*LifecycleComposite) PostNewSession ¶ added in v1.2.0
func (l *LifecycleComposite) PostNewSession(node *Node, session *ssh.Session) error
func (*LifecycleComposite) PostSSHDial ¶ added in v1.2.0
func (l *LifecycleComposite) PostSSHDial(node *Node, client *ssh.Client) error
func (*LifecycleComposite) PostSessionWait ¶ added in v1.2.0
func (l *LifecycleComposite) PostSessionWait(node *Node) error
func (*LifecycleComposite) PostShell ¶ added in v1.2.0
func (l *LifecycleComposite) PostShell(node *Node, stdin io.WriteCloser) error
func (*LifecycleComposite) Priority ¶ added in v1.2.0
func (l *LifecycleComposite) Priority() int
type LifecycleIO ¶ added in v1.2.0
type LifecycleIO struct { }
func (*LifecycleIO) OnStderr ¶ added in v1.2.0
func (*LifecycleIO) OnStderr(node *Node, bytes []byte) error
func (*LifecycleIO) OnStdout ¶ added in v1.2.0
func (*LifecycleIO) OnStdout(node *Node, bytes []byte) error
func (*LifecycleIO) Priority ¶ added in v1.2.0
func (*LifecycleIO) Priority() int
type LifecyclePassword ¶ added in v1.2.0
type LifecyclePassword struct { }
func (*LifecyclePassword) PostInitClientConfig ¶ added in v1.2.0
func (*LifecyclePassword) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
type LifecyclePem ¶ added in v1.2.0
type LifecyclePem struct { }
func (*LifecyclePem) PostInitClientConfig ¶ added in v1.2.0
func (*LifecyclePem) PostInitClientConfig(node *Node, clientConfig *ssh.ClientConfig) error
type LifecycleQueue ¶ added in v1.2.0
type LifecycleQueue []Lifecycle
func (*LifecycleQueue) Len ¶ added in v1.2.0
func (l *LifecycleQueue) Len() int
func (*LifecycleQueue) Less ¶ added in v1.2.0
func (l *LifecycleQueue) Less(i, j int) bool
func (*LifecycleQueue) Pop ¶ added in v1.2.0
func (l *LifecycleQueue) Pop() interface{}
func (*LifecycleQueue) Push ¶ added in v1.2.0
func (l *LifecycleQueue) Push(x interface{})
func (*LifecycleQueue) Swap ¶ added in v1.2.0
func (l *LifecycleQueue) Swap(i, j int)
type LifecycleTerminal ¶ added in v1.2.0
type LifecycleTerminal struct { Callback func() // contains filtered or unexported fields }
func (*LifecycleTerminal) PostNewSession ¶ added in v1.2.0
func (l *LifecycleTerminal) PostNewSession(node *Node, session *ssh.Session) error
func (*LifecycleTerminal) PostSessionWait ¶ added in v1.2.0
func (l *LifecycleTerminal) PostSessionWait(node *Node) error
func (*LifecycleTerminal) PostShell ¶ added in v1.2.0
func (l *LifecycleTerminal) PostShell(node *Node, stdin io.WriteCloser) error
func (*LifecycleTerminal) Priority ¶ added in v1.2.0
func (*LifecycleTerminal) Priority() int
type Logger ¶
type Node ¶
type Node struct { Name string `yaml:"name"` Alias string `yaml:"alias"` ExecsPre []*NodeExec `yaml:"execs-pre"` ExecsStop []*NodeExec `yaml:"execs-stop"` Host string `yaml:"host"` User string `yaml:"user"` Port int `yaml:"port"` KeyPath string `yaml:"keypath"` Passphrase string `yaml:"passphrase"` Password string `yaml:"password"` CallbackShells []*NodeCallbackShell `yaml:"callback-shells"` Children []*Node `yaml:"children"` Jump []*Node `yaml:"jump"` }
type NodeCallbackShell ¶ added in v1.3.0
type TemplateNode ¶ added in v1.4.0
func NewParamNode ¶ added in v1.4.0
func NewParamNode(v string) *TemplateNode
func NewStrNode ¶ added in v1.4.0
func NewStrNode(v string) *TemplateNode
Source Files
¶
Click to show internal directories.
Click to hide internal directories.