model

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 License: MIT Imports: 12 Imported by: 0

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 string, args []string, timeout int) *WorkRequest

NewWorkRequest creats 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) 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 worload

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
)

Jump to

Keyboard shortcuts

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