Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type WorkRequest ¶
type WorkRequest struct {
ID uint64
Name string
Script string
Payload string
Args []string
MessageChan chan []byte
Timeout int
Status WorkStatus
LogFilename string
Err error
// contains filtered or unexported fields
}
WorkRequest is a request of work for a worker
func NewWorkRequest ¶
func NewWorkRequest(name, script, payload, output string, args []string, timeout int) *WorkRequest
NewWorkRequest creates new work request
func (*WorkRequest) GetLogContent ¶
func (wr *WorkRequest) GetLogContent(prefixFilter string) string
GetLogContent returns work logs filtered with the prefix
func (*WorkRequest) IsTerminated ¶
func (wr *WorkRequest) IsTerminated() bool
IsTerminated ask if the work request is terminated
func (*WorkRequest) Meta ¶ added in v1.12.0
func (wr *WorkRequest) Meta() []string
Meta return work request meta
func (*WorkRequest) StatusLabel ¶ added in v1.12.0
func (wr *WorkRequest) StatusLabel() string
StatusLabel return work status as string
func (*WorkRequest) Terminate ¶
func (wr *WorkRequest) Terminate(err error) error
Terminate set work request as terminated
type WorkStatus ¶
type WorkStatus int
WorkStatus is the status of a workload
const ( // Idle means that the work is not yet started Idle WorkStatus = iota // Running means that the work is running Running // Success means that the work over Success // Error means that the work is over but in error Error )
Click to show internal directories.
Click to hide internal directories.