Documentation ¶
Index ¶
- Constants
- func Execute(choreList []Chore) error
- type BasicChore
- func (c *BasicChore) Description() string
- func (c *BasicChore) Execute() ChoreState
- func (c *BasicChore) Name() string
- func (c *BasicChore) Necessary() bool
- func (c *BasicChore) Possible() bool
- func (c *BasicChore) SetDescription(description string)
- func (c *BasicChore) SetExec(exec func() ChoreState)
- func (c *BasicChore) SetName(name string)
- type Chore
- type ChoreState
- type CommandChore
Constants ¶
View Source
const ( OUTPUT_OUT int = 1 << iota OUTPUT_ERR )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BasicChore ¶
type BasicChore struct {
// contains filtered or unexported fields
}
func (*BasicChore) Description ¶
func (c *BasicChore) Description() string
func (*BasicChore) Execute ¶
func (c *BasicChore) Execute() ChoreState
func (*BasicChore) Name ¶
func (c *BasicChore) Name() string
func (*BasicChore) Necessary ¶
func (c *BasicChore) Necessary() bool
func (*BasicChore) Possible ¶
func (c *BasicChore) Possible() bool
func (*BasicChore) SetDescription ¶
func (c *BasicChore) SetDescription(description string)
func (*BasicChore) SetExec ¶
func (c *BasicChore) SetExec(exec func() ChoreState)
func (*BasicChore) SetName ¶
func (c *BasicChore) SetName(name string)
type ChoreState ¶
type ChoreState int
ChoreState is telling the chore result.
const ( // StateSuccess constant StateSuccess ChoreState = iota // StateWarning constant StateWarning // StateError constant StateError )
type CommandChore ¶
type CommandChore struct { BasicChore Command []string WorkingDir string Frequency string Output int SuccessFunc func(*script.ProcessResult) bool // contains filtered or unexported fields }
CommandChore is a chore based on a cli command to be executed.
func NewCommandChore ¶
func NewCommandChore() (chore *CommandChore)
NewCommandChore returns a new command based chore.
func (*CommandChore) Context ¶
func (c *CommandChore) Context() *script.Context
Context returns the CommandChore's script.Context
func (*CommandChore) Execute ¶
func (c *CommandChore) Execute() (choreState ChoreState)
Execute executes a single chore.
Click to show internal directories.
Click to hide internal directories.