Documentation ¶
Overview ¶
Example/development jobs repo.
Index ¶
- Variables
- type Nop
- type ShellCommand
- func (j *ShellCommand) Create(jobArgs map[string]interface{}) error
- func (j *ShellCommand) Deserialize(bytes []byte) error
- func (j *ShellCommand) Id() job.Id
- func (j *ShellCommand) Run(jobData map[string]interface{}) (job.Return, error)
- func (j *ShellCommand) Serialize() ([]byte, error)
- func (j *ShellCommand) Status() string
- func (j *ShellCommand) Stop() error
- type Sleep
- func (j *Sleep) Create(jobArgs map[string]interface{}) error
- func (j *Sleep) Deserialize(bytes []byte) error
- func (j *Sleep) Id() job.Id
- func (j *Sleep) Run(jobData map[string]interface{}) (job.Return, error)
- func (j *Sleep) Serialize() ([]byte, error)
- func (j *Sleep) Status() string
- func (j *Sleep) Stop() error
Constants ¶
This section is empty.
Variables ¶
var Factory job.Factory = factory{}
Factory is a job.Factory that makes "shell-command" type jobs.
Functions ¶
This section is empty.
Types ¶
type Nop ¶
type Nop struct {
// contains filtered or unexported fields
}
Nop is a no-op job that does nothing and always returns success. It's used in place of jobs that we want to include in a job chain but haven't implemented yet.
func (*Nop) Deserialize ¶
type ShellCommand ¶
type ShellCommand struct { // Internal data (serialized) Cmd string `json:"cmd"` // command to execute Args []string `json:"args,omitempty"` // args to cmd *sync.RWMutex // contains filtered or unexported fields }
ShellCommand is a job.Job that runs a single shell command with arguments.
func NewShellCommand ¶
func NewShellCommand(jid job.Id) *ShellCommand
NewShellCommand instantiates a new ShellCommand job. This should only be called by the Factory. jobName must be unique within a job chain.
func (*ShellCommand) Create ¶
func (j *ShellCommand) Create(jobArgs map[string]interface{}) error
Create is a job.Job interface method.
func (*ShellCommand) Deserialize ¶
func (j *ShellCommand) Deserialize(bytes []byte) error
Deserialize is a job.Job interface method.
func (*ShellCommand) Run ¶
func (j *ShellCommand) Run(jobData map[string]interface{}) (job.Return, error)
Run is a job.Job interface method.
func (*ShellCommand) Serialize ¶
func (j *ShellCommand) Serialize() ([]byte, error)
Serialize is a job.Job interface method.
func (*ShellCommand) Status ¶
func (j *ShellCommand) Status() string
Status is a job.Job interface method.
type Sleep ¶
type Sleep struct { // Internal data (serialized) Duration time.Duration `json:"duration"` // how long to sleep *sync.Mutex // contains filtered or unexported fields }
Sleep is a job.Job that sleeps for a given time.
func NewSleep ¶
NewSleep instantiates a new Sleep job. This should only be called by the Factory. jobName must be unique within a job chain.
func (*Sleep) Deserialize ¶
Deserialize is a job.Job interface method.