Documentation ¶
Index ¶
Constants ¶
View Source
const (
SpaceWorker = "worker"
)
Variables ¶
View Source
var ( ErrorInvalidWorkerData = errors.New("invalid process-worker data") ErrorNotExist = errors.New("not exist") ErrorUnknown = errors.New("unknown error") ErrorChangeDriver = errors.New("try change driver") ErrorInvalidProfession = errors.New("invalid profession") ErrorInvalidDriver = errors.New("invalid driver") ErrorInvalidCommand = errors.New("invalid command") )
View Source
var ( CommandSet = "set" CommandDel = "delete" )
Functions ¶
func DecodeWorkerData ¶
func DecodeWorkerData(data []byte) (*eosc.WorkerData, error)
func EncodeWorkerData ¶
func EncodeWorkerData(wd *eosc.WorkerData) ([]byte, error)
func ReadTWorker ¶
Types ¶
type ITypedWorkers ¶
type ITypedWorkers interface { All() []*Worker Set(id string, w *Worker) Get(id string) (*Worker, bool) Del(id string) (*Worker, bool) Reset(ds []*eosc.WorkerData) }
func NewTypedWorkers ¶
func NewTypedWorkers() ITypedWorkers
type TypedWorkers ¶
type TypedWorkers struct {
// contains filtered or unexported fields
}
func (*TypedWorkers) All ¶
func (t *TypedWorkers) All() []*Worker
func (*TypedWorkers) Reset ¶
func (t *TypedWorkers) Reset(ds []*eosc.WorkerData)
func (*TypedWorkers) Set ¶
func (t *TypedWorkers) Set(id string, w *Worker)
type Worker ¶
type Worker struct { *eosc.WorkerData Data WorkerAttr }
func DecodeWorker ¶
func (*Worker) MarshalJSON ¶
type WorkerAttr ¶
type WorkerAttr map[string]interface{}
func (WorkerAttr) Get ¶
func (wa WorkerAttr) Get(field string) string
Click to show internal directories.
Click to hide internal directories.