Documentation
¶
Index ¶
Constants ¶
const (
// FileName is default manifest filename
FileName = "gilbert.yaml"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Job ¶
type Job struct {
// Condition is shell command that should be successful to run specified job
Condition string `yaml:"if,omitempty" mapstructure:"if"`
// Description is job description
Description string `yaml:"description,omitempty" mapstructure:"description"`
// TaskName refers to task that should be run.
TaskName string `yaml:"run,omitempty" mapstructure:"run"`
// PluginName describes what plugin should handle this job.
PluginName string `yaml:"plugin,omitempty" mapstructure:"plugin"`
// MixinName is mixin to be used by this job
MixinName string `yaml:"mixin,omitempty" mapstructure:"mixin"`
// Async means that job should be run asynchronously
Async bool `yaml:"async,omitempty" mapstructure:"async"`
// Delay before task start in milliseconds
Delay Period `yaml:"delay,omitempty" mapstructure:"delay"`
// Period is a time quota for job
Deadline Period `yaml:"deadline,omitempty" mapstructure:"deadline"`
// Vars is a set of variables defined for this job.
Vars scope.Vars `yaml:"vars,omitempty" mapstructure:"vars"`
// Params is a set of arguments for the job.
Params map[string]interface{} `yaml:"params,omitempty" mapstructure:"params"`
}
Job is a single job in task
func (*Job) FormatDescription ¶ added in v0.3.0
FormatDescription returns formatted description string
func (*Job) HasDescription ¶
HasDescription checks if description is available
func (*Job) Type ¶ added in v0.3.0
func (j *Job) Type() JobExecType
Type returns job execution type
If job has no 'plugin', 'task' or 'plugin' declaration, ExecEmpty will be returned
type JobExecType ¶ added in v0.3.0
type JobExecType uint8
JobExecType represents job type
const ( // ExecEmpty means job has no execution type ExecEmpty JobExecType = iota // ExecPlugin means that job execute plugin ExecPlugin // ExecTask means that job runs other task ExecTask // ExecMixin means that job based on mixin ExecMixin )
type Manifest ¶
type Manifest struct {
// Version is gilbert file format version
Version string `yaml:"version"`
// Imports is list of imported presets
Imports []string `yaml:"imports,omitempty"`
// Vars is a set of global variables
Vars scope.Vars `yaml:"vars,omitempty"`
// Tasks is a set of tasks
Tasks TaskSet `yaml:"tasks,omitempty"`
// Mixins is a set of declared mixins
Mixins Mixins `yaml:"mixins,omitempty"`
// contains filtered or unexported fields
}
Manifest represents manifest file (gilbert.yaml)
func FromDirectory ¶ added in v0.2.0
FromDirectory loads gilbert.yaml from specified directory
func LoadManifest ¶ added in v0.5.0
LoadManifest loads manifest from specified path and it's imports
func UnmarshalManifest ¶
UnmarshalManifest parses yaml contents into manifest structure
type Period ¶ added in v0.4.0
type Period uint
Period is job period in milliseconds
func (Period) ToDuration ¶ added in v0.4.0
ToDuration returns value in milliseconds for time.Duration
type PluginConfigError ¶
PluginConfigError is plugin configuration error
func NewPluginConfigError ¶
func NewPluginConfigError(pluginName string, originalError error) *PluginConfigError
NewPluginConfigError creates a new PluginConfigError
func (*PluginConfigError) Error ¶
func (p *PluginConfigError) Error() string
Error satisfies error interface
type Task ¶
type Task []Job
Task is a group of jobs
func (Task) AsyncJobsCount ¶ added in v0.4.0
AsyncJobsCount returns count of async jobs in the task