Documentation ¶
Index ¶
- Variables
- type CmdController
- func (c *CmdController) Abandon()
- func (c *CmdController) GetOutput() string
- func (c *CmdController) GetState(key string) interface{}
- func (c *CmdController) ReplaceCode(old string, new string, n int)
- func (c *CmdController) SetCode(code string)
- func (c *CmdController) SetDelay(n int)
- func (c *CmdController) SetState(key string, value interface{})
- type CmdSample
- type Command
- type ExecCreator
- type Executor
- type ProcessHandler
- type SessionConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Sessions = struct { Remote func(config SessionConfig) execSessionBuilder Local func() execSessionBuilder }{ Remote: newRemoteSession, Local: newLocalSession, }
Functions ¶
This section is empty.
Types ¶
type CmdController ¶
type CmdController struct {
// contains filtered or unexported fields
}
func (*CmdController) GetOutput ¶
func (c *CmdController) GetOutput() string
GetOutput - get command Output
func (*CmdController) ReplaceCode ¶
func (c *CmdController) ReplaceCode(old string, new string, n int)
ReplaceCode
func (*CmdController) SetCode ¶
func (c *CmdController) SetCode(code string)
func (*CmdController) SetDelay ¶
func (c *CmdController) SetDelay(n int)
func (*CmdController) SetState ¶
func (c *CmdController) SetState(key string, value interface{})
SetState
type Command ¶
type Command struct { // 任务名 Name string // 命令 Code string // 描述 Desc string // 执行环境 Session func() (execSession, error) // 是否允许错误 - 异步执行不关心错误 AllowError bool // 是否异步执行 Async bool // 初始化钩子 Init ProcessHandler // 完成钩子 Done ProcessHandler // 是否打印log Logging bool // 延迟执行,单位毫秒, 100毫秒以下设置无效 Delay int // Delay - run after ${delay} millisecond, ignore when < 100 // 环境变量 Env []string // contains filtered or unexported fields }
Command 命令
type ExecCreator ¶
type ExecCreator struct {
// contains filtered or unexported fields
}
func Local ¶
func Local() *ExecCreator
func Remote ¶
func Remote(config SessionConfig) *ExecCreator
type ProcessHandler ¶
type ProcessHandler = func(m *CmdController)
Click to show internal directories.
Click to hide internal directories.