manifest

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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

func (j *Job) FormatDescription() string

FormatDescription returns formatted description string

func (*Job) HasDescription

func (j *Job) HasDescription() bool

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

func FromDirectory(dir string) (m *Manifest, err error)

FromDirectory loads gilbert.yaml from specified directory

func LoadManifest added in v0.5.0

func LoadManifest(path string) (*Manifest, error)

LoadManifest loads manifest from specified path and it's imports

func UnmarshalManifest

func UnmarshalManifest(data []byte) (m *Manifest, err error)

UnmarshalManifest parses yaml contents into manifest structure

func (*Manifest) Location added in v0.2.0

func (m *Manifest) Location() string

Location returns manifest file location, if it was loaded using FromDirectory method

type Mixin added in v0.3.0

type Mixin []Job

Mixin represents a mixin declaration

func (Mixin) ToTask added in v0.3.0

func (m Mixin) ToTask(parentVars scope.Vars) (t Task)

ToTask creates a new task from mixin with variables for override

type Mixins added in v0.3.0

type Mixins map[string]Mixin

Mixins is a pair of mixin name and params

type Period added in v0.4.0

type Period uint

Period is job period in milliseconds

func (Period) ToDuration added in v0.4.0

func (d Period) ToDuration() time.Duration

ToDuration returns value in milliseconds for time.Duration

type PluginConfigError

type PluginConfigError struct {
	PluginName    string
	OriginalError error
}

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 RawParams

type RawParams map[string]interface{}

RawParams is raw plugin params

type Task

type Task []Job

Task is a group of jobs

func (Task) AsyncJobsCount added in v0.4.0

func (t Task) AsyncJobsCount() (count int)

AsyncJobsCount returns count of async jobs in the task

type TaskSet

type TaskSet map[string]Task

TaskSet is a set of tasks declared in a manifest file

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL