model

package
v0.0.0-...-b6983a5 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandSet

type CommandSet struct {
	Generic  *CommandSetCommand   `json:"-"`
	Commands []*CommandSetCommand `json:"commands"`
}

func NewDefaultCommandSet

func NewDefaultCommandSet() *CommandSet

func (*CommandSet) ApplyConfig

func (c *CommandSet) ApplyConfig(conf *config.Job)

func (*CommandSet) DeepCopy

func (c *CommandSet) DeepCopy() *CommandSet

func (*CommandSet) Validate

func (c *CommandSet) Validate() []error

type CommandSetCommand

type CommandSetCommand struct {
	Command       string   `json:"command"`
	Expect        []string `json:"expect"`
	ExpectNot     []string `json:"expect_not"`
	Timeout       int      `json:"timeout"`
	ImplicitEnter bool     `json:"implicit_enter"`
}

func NewDefaultCommandSetCommand

func NewDefaultCommandSetCommand() *CommandSetCommand

func (*CommandSetCommand) ApplyConfig

func (c *CommandSetCommand) ApplyConfig(conf *config.JobCommand)

func (*CommandSetCommand) DeepCopy

func (c *CommandSetCommand) DeepCopy() *CommandSetCommand

func (*CommandSetCommand) Validate

func (c *CommandSetCommand) Validate() []error

Validate after all configs applied

type CronSchedule

type CronSchedule struct {
	// contains filtered or unexported fields
}

func NewCronSchedule

func NewCronSchedule(cron string) (*CronSchedule, error)

func (*CronSchedule) DeepCopy

func (c *CronSchedule) DeepCopy() Schedule

func (*CronSchedule) Next

func (c *CronSchedule) Next(start time.Time) time.Time

type Device

type Device struct {
	Name               string `json:"name"`
	Host               string `json:"host"`
	*DeviceCredentials `json:"credentials"`
	*DeviceProtocol    `json:"protocol"`
	Tags               []string        `json:"-"`
	Jobs               map[string]*Job `json:"-"`
}

func NewDefaultDevice

func NewDefaultDevice(name string) *Device

func (*Device) ApplyConfig

func (d *Device) ApplyConfig(conf *config.Device) error

func (*Device) Validate

func (d *Device) Validate() []error

type DeviceCredentials

type DeviceCredentials struct {
	User string `json:"user"`
	Pass string `json:"pass"`
}

type DeviceProtocol

type DeviceProtocol struct {
	Type               string `json:"type"`
	*SshDeviceProtocol `json:"ssh,omitempty"`
}

type Execution

type Execution struct {
	Device    *Device `json:"device"`
	Job       *Job    `json:"job"`
	Timestamp int64   `json:"timestamp"`
}

type FileSet

type FileSet struct {
	Files []*FileSetFile
}

func NewDefaultFileSet

func NewDefaultFileSet() *FileSet

func (*FileSet) ApplyConfig

func (f *FileSet) ApplyConfig(conf *config.Job)

func (*FileSet) DeepCopy

func (f *FileSet) DeepCopy() *FileSet

func (*FileSet) Validate

func (f *FileSet) Validate() []error

type FileSetFile

type FileSetFile struct {
	Name        string `json:"name"`
	Compression string `json:"compression"`
}

func NewDefaultFileSetFile

func NewDefaultFileSetFile() *FileSetFile

func (*FileSetFile) ApplyConfig

func (f *FileSetFile) ApplyConfig(fileName string, conf *config.JobFile)

func (*FileSetFile) DeepCopy

func (f *FileSetFile) DeepCopy() *FileSetFile

func (*FileSetFile) Validate

func (f *FileSetFile) Validate() []error

type Job

type Job struct {
	Name           string `json:"name"`
	*CommandSet    `json:"command_set"`
	*FileSet       `json:"file_set"`
	Schedule       `json:"-"`
	Scrubbers      []*JobScrubber    `json:"scrubbers"`
	TemplateValues map[string]string `json:"template_values"`
}

func NewDefaultJob

func NewDefaultJob(name string) *Job

func (*Job) ApplyConfig

func (j *Job) ApplyConfig(conf *config.Job) error

func (*Job) ApplyTemplateValues

func (j *Job) ApplyTemplateValues()

func (*Job) DeepCopy

func (j *Job) DeepCopy() *Job

func (*Job) Validate

func (j *Job) Validate() []error

type JobScrubber

type JobScrubber struct {
	Type    string `json:"type"`
	Search  string `json:"search"`
	Replace string `json:"replace"`
}

func NewJobScrubberFromConfig

func NewJobScrubberFromConfig(conf *config.JobScrubber) *JobScrubber

func (*JobScrubber) DeepCopy

func (j *JobScrubber) DeepCopy() *JobScrubber

func (*JobScrubber) Validate

func (j *JobScrubber) Validate() error

type Schedule

type Schedule interface {
	// Exclusive
	Next(start time.Time) time.Time
	DeepCopy() Schedule
}

func NewScheduleFromConfig

func NewScheduleFromConfig(sched *config.JobSchedule) (Schedule, error)

type SshDeviceProtocol

type SshDeviceProtocol struct {
	Port              int  `json:"port"`
	IncludeCbcCiphers bool `json:"include_cbc_ciphers"`
}

Jump to

Keyboard shortcuts

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