Documentation ¶
Index ¶
- Constants
- Variables
- func NewCmdStepCfg() *cmd.Cfg
- func NewPipelineCfg() *pipeline.Cfg
- type Cfg
- type CmdStep
- type Collector
- type FtpStep
- type FtpStepCfg
- type Hook
- type HookExtraData
- type PipelineStep
- type Result
- type SSHStep
- type SSHStepCfg
- type Step
- type StepCfg
- type StepHook
- type StepType
- type Task
- func (t *Task) CurDeferStep() Step
- func (t *Task) CurStep() Step
- func (t *Task) DeferSteps() []Step
- func (t *Task) GetCfg() interface{}
- func (t *Task) Init() error
- func (t *Task) RegisterCollector(c Collector)
- func (t *Task) RegisterDeferStepDoneHook(hook ...StepHook)
- func (t *Task) RegisterStepDoneHook(hook ...StepHook)
- func (t *Task) Result() interface{}
- func (t *Task) Start() error
- func (t *Task) Steps() []Step
- func (t *Task) Stop() error
- func (t *Task) Store(k string, v any)
- func (t *Task) Type() interface{}
- type Type
Constants ¶
View Source
const PluginTypeTask plugin.Type = "task"
Variables ¶
View Source
var CreateBaseStep = newBase
Functions ¶
func NewCmdStepCfg ¶ added in v0.8.1
func NewPipelineCfg ¶ added in v0.6.9
Types ¶
type Cfg ¶
type Cfg struct { ID string `json:"id" validate:"required" yaml:"id"` Type Type `json:"type" validate:"required" yaml:"type"` Steps []*StepCfg `json:"steps" validate:"required" yaml:"steps"` DeferSteps []*StepCfg `json:"deferSteps" yaml:"deferSteps"` CurStepIdx int `json:"curStepIdx" yaml:"curStepIdx"` CurDeferStepIdx int `json:"curDeferStepIdx" yaml:"curDeferStepIdx"` }
type CmdStep ¶ added in v0.8.1
func NewCmdStep ¶
func NewCmdStep() *CmdStep
type FtpStep ¶ added in v0.8.1
type FtpStep struct { Step *FtpStepCfg // contains filtered or unexported fields }
func NewFtpStep ¶ added in v0.8.1
func NewFtpStep() *FtpStep
type FtpStepCfg ¶ added in v0.8.1
type FtpStepCfg struct { Addr string `json:"addr" yaml:"addr" validate:"required"` User string `json:"user" yaml:"user" validate:"required"` Pwd string `json:"pwd" yaml:"pwd"` Timeout int `json:"timeout" yaml:"timeout"` Retry int `json:"retry" yaml:"retry"` Cmd string `json:"cmd" yaml:"cmd" validate:"required"` Args []string `json:"args" yaml:"args"` }
func NewFtpStepCfg ¶ added in v0.8.1
func NewFtpStepCfg() *FtpStepCfg
type Hook ¶ added in v0.7.1
type Hook func(*Task, error, *HookExtraData)
type HookExtraData ¶ added in v0.7.1
type PipelineStep ¶ added in v0.8.1
func NewPipelineStep ¶ added in v0.6.9
func NewPipelineStep() *PipelineStep
func (*PipelineStep) GetCfg ¶ added in v0.8.1
func (p *PipelineStep) GetCfg() interface{}
func (*PipelineStep) Init ¶ added in v0.8.1
func (p *PipelineStep) Init() error
func (*PipelineStep) Start ¶ added in v0.8.1
func (p *PipelineStep) Start() error
func (*PipelineStep) Stop ¶ added in v0.8.1
func (p *PipelineStep) Stop() error
func (*PipelineStep) Type ¶ added in v0.8.1
func (p *PipelineStep) Type() interface{}
type SSHStep ¶ added in v0.8.1
type SSHStep struct { Step *SSHStepCfg // contains filtered or unexported fields }
func NewSSHStep ¶ added in v0.8.1
func NewSSHStep() *SSHStep
type SSHStepCfg ¶ added in v0.8.1
type SSHStepCfg struct { Addr string `json:"addr" yaml:"addr" validate:"required"` User string `json:"user" yaml:"user" validate:"required"` Pwd string `json:"pwd" yaml:"pwd" validate:"required"` PrivateKey string `json:"privateKey" yaml:"privateKey"` Timeout int `json:"timeout" yaml:"timeout"` Cmd string `json:"cmd" yaml:"cmd" validate:"required"` Args []string `json:"args" yaml:"args"` }
func NewSSHStepCfg ¶ added in v0.8.1
func NewSSHStepCfg() *SSHStepCfg
type StepCfg ¶
type StepCfg struct { Type StepType `json:"type" validate:"required" yaml:"type"` Cfg interface{} `json:"cfg" validate:"required" yaml:"cfg"` }
type StepType ¶
type StepType string
const StepTypeCmd StepType = "cmd"
const StepTypeFtp StepType = "ftp"
const StepTypePipeline StepType = "pipeline"
const StepTypeSSH StepType = "ssh"
type Task ¶
func (*Task) CurDeferStep ¶
func (*Task) DeferSteps ¶
func (*Task) RegisterCollector ¶ added in v0.3.9
func (*Task) RegisterDeferStepDoneHook ¶
func (*Task) RegisterStepDoneHook ¶
Click to show internal directories.
Click to hide internal directories.