{"modulePath":"github.com/AliceO2Group/Control","version":"v1.51.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package controlcommands\n\nPackage controlcommands defines the Command interface, plus several types including MesosCommand, MesosCommandResponse and related. It contains what's needed to represent the serializable requests and responses that are then transferred over the Mesos transport.\n\n## Constants\n\n```go\nconst QUEUE_SIZE = 16384 // upper limit of command queue size\n\n```\n\n## Types\n\n```go\ntype Call struct {\n\tRequest  MesosCommand\n\tResponse MesosCommandResponse\n\tDone     chan empty\n\tError    error\n}\n```\nCall represents an active request, pending response\n\n```go\nfunc NewCall(cmd MesosCommand) *Call\n```\n\n```go\ntype CallId struct {\n\tId     xid.ID\n\tTarget MesosCommandTarget\n}\n```\n\n```go\ntype Command interface {\n\tName() string\n\tArgs() map[string]interface{}\n\tIsMultiCmd() bool\n\tIsMutator() bool\n}\n```\n\n```go\ntype CommandQueue struct {\n\tsync.Mutex\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewCommandQueue(s *Servent) *CommandQueue\n```\n\n```go\nfunc (m *CommandQueue) Enqueue(cmd MesosCommand, callback chan\u003c- MesosCommandResponse) error\n```\n\n```go\nfunc (m *CommandQueue) Start()\n```\n\n```go\nfunc (m *CommandQueue) Stop()\n```\n\n```go\ntype MesosCommand interface {\n\tcommon.Labeler\n\tGetName() string\n\tGetId() xid.ID\n\tGetEnvironmentId() uid.ID\n\tIsMultiCmd() bool\n\tMakeSingleTarget(target MesosCommandTarget) MesosCommand\n\tIsMutator() bool\n\tGetResponseTimeout() time.Duration\n\t// contains filtered or unexported methods\n}\n```\n\n```go\ntype MesosCommandBase struct {\n\tName            string               `json:\"name\"`\n\tId              xid.ID               `json:\"id\"`\n\tEnvironmentId   uid.ID               `json:\"environmentId\"`\n\tResponseTimeout time.Duration        `json:\"timeout\"`\n\tArguments       PropertyMap          `json:\"arguments\"`\n\tTargetList      []MesosCommandTarget `json:\"targetList\"`\n\tLabels          map[string]string    `json:\"labels\"`\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewMesosCommand(name string, envId uid.ID, receivers []MesosCommandTarget, argMap PropertyMapsMap) *MesosCommandBase\n```\n\n```go\nfunc (m *MesosCommandBase) GetEnvironmentId() uid.ID\n```\n\n```go\nfunc (m *MesosCommandBase) GetId() xid.ID\n```\n\n```go\nfunc (m *MesosCommandBase) GetLabels() map[string]string\n```\n\n```go\nfunc (m *MesosCommandBase) GetName() string\n```\n\n```go\nfunc (m *MesosCommandBase) GetResponseTimeout() time.Duration\n```\n\n```go\nfunc (m *MesosCommandBase) IsMultiCmd() bool\n```\n\n```go\nfunc (m *MesosCommandBase) IsMutator() bool\n```\n\n```go\nfunc (m *MesosCommandBase) MakeSingleTarget(receiver MesosCommandTarget) (cmd MesosCommand)\n```\n\n```go\ntype MesosCommandMultiResponse struct {\n\tMesosCommandResponseBase\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (m *MesosCommandMultiResponse) Err() error\n```\n\n```go\nfunc (m *MesosCommandMultiResponse) Errors() map[MesosCommandTarget]error\n```\n\n```go\nfunc (m *MesosCommandMultiResponse) GetResponseSenders() []MesosCommandTarget\n```\n\n```go\nfunc (m *MesosCommandMultiResponse) GetResponses() map[MesosCommandTarget]MesosCommandResponse\n```\n\n```go\nfunc (m *MesosCommandMultiResponse) IsMultiResponse() bool\n```\n\n```go\ntype MesosCommandResponse interface {\n\tGetCommandName() string\n\tGetCommandId() xid.ID\n\tGetEnvironmentId() uid.ID\n\tGetResponseSenders() []MesosCommandTarget\n\tIsMultiResponse() bool\n\tErr() error\n\tErrors() map[MesosCommandTarget]error\n}\n```\n\n```go\ntype MesosCommandResponseBase struct {\n\tCommandName     string               `json:\"name\"`\n\tCommandId       xid.ID               `json:\"id\"`\n\tEnvironmentId   uid.ID               `json:\"environmentId\"`\n\tErrorString     string               `json:\"error\"`\n\tMessageType     string               `json:\"_messageType\"`\n\tResponseSenders []MesosCommandTarget `json:\"-\"`\n}\n```\n\n```go\nfunc NewMesosCommandResponse(mesosCommand MesosCommand, err error) *MesosCommandResponseBase\n```\n\n```go\nfunc (m *MesosCommandResponseBase) Err() error\n```\n\n```go\nfunc (m *MesosCommandResponseBase) Errors() map[MesosCommandTarget]error\n```\ndummy implementation for single-origin responses which defaults to Err()\n\n```go\nfunc (m *MesosCommandResponseBase) GetCommandId() xid.ID\n```\n\n```go\nfunc (m *MesosCommandResponseBase) GetCommandName() string\n```\n\n```go\nfunc (m *MesosCommandResponseBase) GetEnvironmentId() uid.ID\n```\n\n```go\nfunc (m *MesosCommandResponseBase) GetResponseSenders() []MesosCommandTarget\n```\n\n```go\nfunc (m *MesosCommandResponseBase) IsMultiResponse() bool\n```\n\n```go\ntype MesosCommandResponse_Transition struct {\n\tMesosCommandResponseBase\n\n\tCurrentState string `json:\"state\"`\n\tTaskId       string `json:\"taskId\"`\n}\n```\n\n```go\nfunc NewMesosCommandResponse_Transition(mesosCommand *MesosCommand_Transition, err error, currentState string, taskId string) *MesosCommandResponse_Transition\n```\n\n```go\ntype MesosCommandResponse_TriggerHook struct {\n\tMesosCommandResponseBase\n\tTaskId string `json:\"taskId\"`\n}\n```\n\n```go\nfunc NewMesosCommandResponse_TriggerHook(mesosCommand *MesosCommand_TriggerHook, err error, taskId string) *MesosCommandResponse_TriggerHook\n```\n\n```go\ntype MesosCommandTarget struct {\n\tAgentId    mesos.AgentID\n\tExecutorId mesos.ExecutorID\n\tTaskId     mesos.TaskID\n}\n```\n\n```go\ntype MesosCommand_Transition struct {\n\tMesosCommandBase\n\n\tSource      string `json:\"source\"`\n\tEvent       string `json:\"event\"`\n\tDestination string `json:\"destination\"`\n}\n```\n\n```go\nfunc NewMesosCommand_Transition(envId uid.ID, receivers []MesosCommandTarget, source string, event string, destination string, arguments PropertyMapsMap) *MesosCommand_Transition\n```\n\n```go\nfunc (m *MesosCommand_Transition) MakeSingleTarget(target MesosCommandTarget) (cmd MesosCommand)\n```\n\n```go\ntype MesosCommand_TriggerHook struct {\n\tMesosCommandBase\n}\n```\n\n```go\nfunc NewMesosCommand_TriggerHook(envId uid.ID, receivers []MesosCommandTarget) *MesosCommand_TriggerHook\n```\n\n```go\nfunc (m *MesosCommand_TriggerHook) MakeSingleTarget(target MesosCommandTarget) (cmd MesosCommand)\n```\n\n```go\ntype PropertyMap map[string]string\n```\n\n```go\ntype PropertyMapsMap map[MesosCommandTarget]PropertyMap\n```\n\n```go\ntype SendCommandFunc func(command MesosCommand, receiver MesosCommandTarget) error\n```\n\n```go\ntype Servent struct {\n\tSendFunc SendCommandFunc\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewServent(commandFunc SendCommandFunc) *Servent\n```\n\n```go\nfunc (s *Servent) ProcessResponse(res MesosCommandResponse, sender MesosCommandTarget)\n```\n\n```go\nfunc (s *Servent) RunCommand(cmd MesosCommand, receiver MesosCommandTarget) (MesosCommandResponse, error)\n```\n\n","path":"github.com/AliceO2Group/Control/core/controlcommands","name":"controlcommands","synopsis":"Package controlcommands defines the Command interface, plus several types including MesosCommand, MesosCommandResponse and related.","isRedistributable":true}
