Documentation ¶
Index ¶
Constants ¶
View Source
const ( CommandSet = "set" CommandDel = "delete" )
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") )
Functions ¶
func DecodeWorkerData ¶
func DecodeWorkerData(data []byte) (*eosc.WorkerConfig, error)
func EncodeWorkerData ¶
func EncodeWorkerData(wd *eosc.WorkerConfig) ([]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.WorkerConfig) }
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.WorkerConfig)
func (*TypedWorkers) Set ¶
func (t *TypedWorkers) Set(id string, w *Worker)
type Worker ¶
type Worker struct { *eosc.WorkerConfig 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.