Documentation
¶
Index ¶
Constants ¶
View Source
const ( //ArgDomain domain ArgDomain = "domain" //ArgName name ArgName = "name" //ArgMaxTime max time ArgMaxTime = "max_time" //ArgMaxRestart max restart ArgMaxRestart = "max_restart" //ArgRecurringPeriod recurring period ArgRecurringPeriod = "recurring_period" //ArgStatsInterval stats interval ArgStatsInterval = "stats_interval" //ArgCmdArguments cmd arguments ArgCmdArguments = "args" //ArgQueue queue ArgQueue = "queue" //StateRunning running state StateRunning = "RUNNING" //StateQueued queued state StateQueued = "QUEUED" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Run(cmd *Command) (*CommandReference, error) GetJobs(ID string, timeout int) ([]*Job, error) }
Client interface
type Command ¶
type Command struct { ID string `json:"id"` Gid int `json:"gid"` Nid int `json:"nid"` Cmd string `json:"cmd"` Args RunArgs `json:"args"` Data string `json:"data"` Roles []string `json:"roles"` Fanout bool `json:"fanout"` }
Command represents a command
type CommandReference ¶
type CommandReference struct { ID string // contains filtered or unexported fields }
CommandReference is an executed command
func (*CommandReference) GetJobs ¶
func (ref *CommandReference) GetJobs(timeout int) ([]*Job, error)
GetJobs get command jobs
func (*CommandReference) GetNextResult ¶
func (ref *CommandReference) GetNextResult(timeout int) (*Job, error)
GetNextResult returns the next available result
type Job ¶
type Job struct { ID string `json:"id"` Gid int `json:"gid"` Nid int `json:"nid"` Cmd string `json:"cmd"` Data string `json:"data"` Streams []string `json:"streams` Level int `json:"level"` Starttime int `json:"starttime"` State string `json:"state"` Time int `json:"time"` // contains filtered or unexported fields }
Job represents a job
type RunArgs ¶
type RunArgs map[string]interface{}
RunArgs holds the execution arguments
func NewDefaultRunArgs ¶
func NewDefaultRunArgs() RunArgs
NewDefaultRunArgs creates a new default run arguments with default values
func NewRunArgs ¶
func NewRunArgs(domain string, name string, maxTime int, maxRestart int, recurrintPeriod int, statsInterval int, args []string, queue string) RunArgs
NewRunArgs creates a new run arguments
func (RunArgs) MaxRestart ¶
MaxRestart max number of restart before giving up
func (RunArgs) RecurringPeriod ¶
RecurringPeriod recurring period
Click to show internal directories.
Click to hide internal directories.