Documentation ¶
Index ¶
- Variables
- type Announce
- type Cmd
- type CronExpression
- type Runtime
- func (this *Runtime) Announce() chan<- Announce
- func (this *Runtime) ApplyEnvAndFuncs(env map[string]interface{}, funcs map[string]interface{}) error
- func (this *Runtime) CaptureStdout()
- func (this *Runtime) Error(error interface{}) error
- func (this *Runtime) GetCapturedStdout() []byte
- func (this *Runtime) Log(m ...interface{})
- func (this *Runtime) Now() int64
- func (this *Runtime) PublishStdin() io.Writer
- func (this *Runtime) Running() bool
- func (this *Runtime) Start() (chan error, error)
- func (this *Runtime) Stderr() io.Writer
- func (this *Runtime) Stdin() io.Reader
- func (this *Runtime) StdinInterceptor(f func(string) (string, bool))
- func (this *Runtime) Stdout() io.Writer
- func (this *Runtime) Stop()
- func (this *Runtime) Success(output interface{}) error
- type Task
- type TaskName
- type TaskStats
- type Trigger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrBadConfig = errors.New("bad-config") ErrBadConfigInfo = errors.New("bad-config-info") ErrBadConfigStatus = errors.New("bad-config-status") ErrBadConfigSuccess = errors.New("bad-config-success") ErrBadConfigError = errors.New("bad-config-error") ErrBadConfigCmdNotFound = errors.New("bad-config-cmd-not-found") ErrStopped = errors.New("stopped") ErrTimeout = errors.New("timeout") )
View Source
var ( ErrCommandUnknown = errors.New("command-unknown") ErrExecFailed = errors.New("exec-failed") )
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct { Dir string `json:"working_dir,omitempty"` Path string `json:"path"` Args []string `json:"args"` Env []string `json:"env"` }
func (*Cmd) ApplySubstitutions ¶
func (this *Cmd) ApplySubstitutions(env map[string]interface{}, funcs template.FuncMap) (*Cmd, error)
Given the environments apply any substitutions to the command and args the format is same as template expressions e.g. {{.RUN_BINARY}} This allows the environment to be passed to the command even if the child process does not look at environment variables.
type CronExpression ¶
type CronExpression string
type Runtime ¶
type Runtime struct { Task TimestampStart int64 TimestampExit int64 Status string // contains filtered or unexported fields }
func (*Runtime) ApplyEnvAndFuncs ¶
func (*Runtime) CaptureStdout ¶
func (this *Runtime) CaptureStdout()
func (*Runtime) GetCapturedStdout ¶
func (*Runtime) PublishStdin ¶
func (*Runtime) StdinInterceptor ¶
type Task ¶
type Task struct { // Required Id string `json:"id,omitempty"` Cmd *Cmd `json:"cmd,omitempty"` // If this is set to true then we only require id and command to be set ExecOnly bool `json:"exec_only"` Name TaskName `json:"name"` // Optional namespace for task related announcements in the regstry. Namespace *registry.Path `json:"namespace,omitempty"` // Optional success / error == for signaling other watchers Success *registry.Path `json:"success,omitempty"` Error *registry.Path `json:"error,omitempty"` // Conditional execution Trigger *Trigger `json:"trigger,omitempty"` // Topics (e.g. mqtt://localhost:1281/aws-cli/124/stdout) LogTopic pubsub.Topic `json:"log,omitempty"` Stdin *pubsub.Topic `json:"stdin,omitempty"` Stdout *pubsub.Topic `json:"stdout,omitempty"` Stderr *pubsub.Topic `json:"stderr,omitempty"` Runs int `json:"runs,omitempty"` Stats TaskStats `json:"stats,omitempty"` LogTemplateStart *string `json:"log_template_start,omitempty"` LogTemplateStop *string `json:"log_template_stop,omitempty"` LogTemplateSuccess *string `json:"log_template_success,omitempty"` LogTemplateError *string `json:"log_template_error,omitempty"` // contains filtered or unexported fields }
type TaskStats ¶ added in v1.0.2
type TaskStats struct { Started int64 `json:"started,omitempty"` Triggered int64 `json:"triggered,omitempty"` Success int64 `json:"success,omitempty"` Error int64 `json:"error,omitempty"` }
Written to the Info path of the task
type Trigger ¶
type Trigger struct { Cron *CronExpression `json:"cron,omitempty"` Registry *registry.Conditions `json:"registry,omitempty"` }
TODO -- add ordering. Cron before Registry, or Registry activates cron
Click to show internal directories.
Click to hide internal directories.