Version: v0.1.1 Latest Latest

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 12 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Baito

type Baito struct {
	FieldName        string
	FieldSchedule    Schedule
	FieldWorkdir     string
	FieldLogsFile    io.WriteSyncer
	FieldVariables   map[string]string
	FieldEnvironment map[string]string
	FieldCommands    []runner.Runner

A Baito (aka Arubaito from German Arbeit) is a task/job that will be runned at a scheduled time.

func (*Baito) Commands

func (b *Baito) Commands() []runner.Runner

Commands returns the commands to be executed.

func (*Baito) Environment

func (b *Baito) Environment() map[string]string

Environment returns the environment variables.

func (*Baito) ExpandAll

func (b *Baito) ExpandAll(str string) string

ExpandAll replace templatized variables and environment variables by their values.

func (*Baito) ExpandEnv

func (b *Baito) ExpandEnv(str string) string

ExpandEnv replaces ${var} or $var in the string according to the values of the current environment variables. References to undefined variables left as there are.

func (*Baito) ExpandVariables

func (b *Baito) ExpandVariables(str string) string

ExpandVariables replace templatized variables by their values.

func (*Baito) LogsFile

func (b *Baito) LogsFile() io.WriteSyncer

LogsFile returns the logs file where stdout/stderr are redirected.

func (*Baito) Name

func (b *Baito) Name() string

Name returns the name.

func (*Baito) Schedule

func (b *Baito) Schedule() Schedule

Schedule returns the schedule.

func (*Baito) Variables

func (b *Baito) Variables() map[string]string

Variables returns the variables.

func (*Baito) Workdir

func (b *Baito) Workdir() string

Workdir returns the working directory.

type Schedule

type Schedule cron.Schedule

A Schedule describes a job's duty cycle.

type Shigoto

type Shigoto struct {
	Name  string
	Baito map[string]Baito
	// contains filtered or unexported fields

Shigoto represents a shigoto.yml

func Load

func Load(filename string) (*Shigoto, error)

Load loads a Shigoto from the given filename.

func (*Shigoto) Same

func (s *Shigoto) Same(shigoto *Shigoto) bool

Same returns true if both shigoto are the same.

Jump to

Keyboard shortcuts

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