Documentation
¶
Index ¶
- type ChanWriter
- type Task
- func (t *Task) Fprint(w io.Writer, s string) (n int, err error)
- func (t Task) Run() error
- func (t Task) RunForever(ctx context.Context)
- func (t *Task) RunTasks(ctx context.Context)
- func (t Task) RunWithContext(ctx context.Context) error
- func (t Task) String() string
- func (t *Task) WriterWrapper(ctx context.Context, w io.Writer) io.Writer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChanWriter ¶
type ChanWriter chan []byte
type Task ¶
type Task struct {
// 任务名称
Name string `yaml:"name,omitempty" json:"name,omitempty" toml:"name,omitempty"`
// 任务介绍
Desc string `yaml:"desc,omitempty" json:"desc,omitempty" toml:"desc,omitempty"`
// 工作路径
Dir string `yaml:"dir,omitempty" json:"dir,omitempty" toml:"dir,omitempty"`
// 环境变量
Env []string `yaml:"env,omitempty" json:"env,omitempty" toml:"env,omitempty"`
// 命令名
Cmd string `yaml:"cmd,omitempty" json:"cmd,omitempty" toml:"cmd,omitempty"`
// 命令参数
Args []string `yaml:"args,omitempty" json:"args,omitempty" toml:"args,omitempty"`
// 输出模板
Format string `yaml:"format,omitempty" json:"format,omitempty" toml:"format,omitempty"`
// 延迟启动
Delay float64 `yaml:"delay,omitempty" json:"delay,omitempty" toml:"delay,omitempty"`
// 重试间隔
Interval float64 `yaml:"interval,omitempty" json:"interval,omitempty" toml:"interval,omitempty"`
// 子任务
Tasks []Task `yaml:"tasks,omitempty" json:"tasks,omitempty" toml:"tasks,omitempty"`
// 常规输出
Out io.Writer `yaml:"-" json:"-" toml:"-"`
// 错误输出
Err io.Writer `yaml:"-" json:"-" toml:"-"`
// 合并输出间隔
MergeThreshold time.Duration `yaml:"-" json:"-" toml:"-"`
// 强制输出超时
FlushTimeout time.Duration `yaml:"-" json:"-" toml:"-"`
}
任务
Click to show internal directories.
Click to hide internal directories.