Documentation ¶
Overview ¶
Package 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.
Index ¶
- Constants
- type Call
- type CallId
- type Command
- type CommandQueue
- type MesosCommand
- type MesosCommandBase
- func (m *MesosCommandBase) GetId() xid.ID
- func (m *MesosCommandBase) GetName() string
- func (m *MesosCommandBase) GetResponseTimeout() time.Duration
- func (m *MesosCommandBase) IsMultiCmd() bool
- func (m *MesosCommandBase) IsMutator() bool
- func (m *MesosCommandBase) MakeSingleTarget(receiver MesosCommandTarget) (cmd MesosCommand)
- type MesosCommandMultiResponse
- func (m *MesosCommandMultiResponse) Err() error
- func (m *MesosCommandMultiResponse) Errors() map[MesosCommandTarget]error
- func (m *MesosCommandMultiResponse) GetResponseSenders() []MesosCommandTarget
- func (m *MesosCommandMultiResponse) GetResponses() map[MesosCommandTarget]MesosCommandResponse
- func (m *MesosCommandMultiResponse) IsMultiResponse() bool
- type MesosCommandResponse
- type MesosCommandResponseBase
- func (m *MesosCommandResponseBase) Err() error
- func (m *MesosCommandResponseBase) Errors() map[MesosCommandTarget]error
- func (m *MesosCommandResponseBase) GetCommandId() xid.ID
- func (m *MesosCommandResponseBase) GetCommandName() string
- func (m *MesosCommandResponseBase) GetResponseSenders() []MesosCommandTarget
- func (m *MesosCommandResponseBase) IsMultiResponse() bool
- type MesosCommandResponse_Transition
- type MesosCommandResponse_TriggerHook
- type MesosCommandTarget
- type MesosCommand_Transition
- type MesosCommand_TriggerHook
- type PropertyMap
- type PropertyMapsMap
- type SendCommandFunc
- type Servent
Constants ¶
View Source
const QUEUE_SIZE = 1024
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Call ¶
type Call struct { Request MesosCommand Response MesosCommandResponse Done chan empty Error error }
Call represents an active request, pending response
func NewCall ¶
func NewCall(cmd MesosCommand) *Call
type CallId ¶
type CallId struct { Id xid.ID Target MesosCommandTarget }
type CommandQueue ¶
func NewCommandQueue ¶
func NewCommandQueue(s *Servent) *CommandQueue
func (*CommandQueue) Enqueue ¶
func (m *CommandQueue) Enqueue(cmd MesosCommand, callback chan<- MesosCommandResponse) error
func (*CommandQueue) Start ¶
func (m *CommandQueue) Start()
func (*CommandQueue) Stop ¶
func (m *CommandQueue) Stop()
type MesosCommand ¶
type MesosCommand interface { GetName() string GetId() xid.ID IsMultiCmd() bool MakeSingleTarget(target MesosCommandTarget) MesosCommand IsMutator() bool GetResponseTimeout() time.Duration // contains filtered or unexported methods }
type MesosCommandBase ¶
type MesosCommandBase struct { Name string `json:"name"` Id xid.ID `json:"id"` ResponseTimeout time.Duration `json:"timeout"` Arguments PropertyMap `json:"arguments"` TargetList []MesosCommandTarget `json:"targetList"` // contains filtered or unexported fields }
func NewMesosCommand ¶
func NewMesosCommand(name string, receivers []MesosCommandTarget, argMap PropertyMapsMap) *MesosCommandBase
func (*MesosCommandBase) GetId ¶
func (m *MesosCommandBase) GetId() xid.ID
func (*MesosCommandBase) GetName ¶
func (m *MesosCommandBase) GetName() string
func (*MesosCommandBase) GetResponseTimeout ¶
func (m *MesosCommandBase) GetResponseTimeout() time.Duration
func (*MesosCommandBase) IsMultiCmd ¶
func (m *MesosCommandBase) IsMultiCmd() bool
func (*MesosCommandBase) IsMutator ¶
func (m *MesosCommandBase) IsMutator() bool
func (*MesosCommandBase) MakeSingleTarget ¶
func (m *MesosCommandBase) MakeSingleTarget(receiver MesosCommandTarget) (cmd MesosCommand)
type MesosCommandMultiResponse ¶
type MesosCommandMultiResponse struct { MesosCommandResponseBase // contains filtered or unexported fields }
func (*MesosCommandMultiResponse) Err ¶
func (m *MesosCommandMultiResponse) Err() error
func (*MesosCommandMultiResponse) Errors ¶ added in v0.26.80
func (m *MesosCommandMultiResponse) Errors() map[MesosCommandTarget]error
func (*MesosCommandMultiResponse) GetResponseSenders ¶ added in v0.26.80
func (m *MesosCommandMultiResponse) GetResponseSenders() []MesosCommandTarget
func (*MesosCommandMultiResponse) GetResponses ¶
func (m *MesosCommandMultiResponse) GetResponses() map[MesosCommandTarget]MesosCommandResponse
func (*MesosCommandMultiResponse) IsMultiResponse ¶
func (m *MesosCommandMultiResponse) IsMultiResponse() bool
type MesosCommandResponse ¶
type MesosCommandResponse interface { GetCommandName() string GetCommandId() xid.ID GetResponseSenders() []MesosCommandTarget IsMultiResponse() bool Err() error Errors() map[MesosCommandTarget]error }
type MesosCommandResponseBase ¶
type MesosCommandResponseBase struct { CommandName string `json:"name"` CommandId xid.ID `json:"id"` ErrorString string `json:"error"` MessageType string `json:"_messageType"` ResponseSenders []MesosCommandTarget `json:"-"` }
func NewMesosCommandResponse ¶
func NewMesosCommandResponse(mesosCommand MesosCommand, err error) *MesosCommandResponseBase
func (*MesosCommandResponseBase) Err ¶
func (m *MesosCommandResponseBase) Err() error
func (*MesosCommandResponseBase) Errors ¶ added in v0.26.80
func (m *MesosCommandResponseBase) Errors() map[MesosCommandTarget]error
dummy implementation for single-origin responses which defaults to Err()
func (*MesosCommandResponseBase) GetCommandId ¶
func (m *MesosCommandResponseBase) GetCommandId() xid.ID
func (*MesosCommandResponseBase) GetCommandName ¶
func (m *MesosCommandResponseBase) GetCommandName() string
func (*MesosCommandResponseBase) GetResponseSenders ¶ added in v0.26.80
func (m *MesosCommandResponseBase) GetResponseSenders() []MesosCommandTarget
func (*MesosCommandResponseBase) IsMultiResponse ¶
func (m *MesosCommandResponseBase) IsMultiResponse() bool
type MesosCommandResponse_Transition ¶
type MesosCommandResponse_Transition struct { MesosCommandResponseBase CurrentState string `json:"state"` TaskId string `json:"taskId"` }
func NewMesosCommandResponse_Transition ¶
func NewMesosCommandResponse_Transition(mesosCommand *MesosCommand_Transition, err error, currentState string, taskId string) *MesosCommandResponse_Transition
type MesosCommandResponse_TriggerHook ¶ added in v0.16.0
type MesosCommandResponse_TriggerHook struct { MesosCommandResponseBase TaskId string `json:"taskId"` }
func NewMesosCommandResponse_TriggerHook ¶ added in v0.16.0
func NewMesosCommandResponse_TriggerHook(mesosCommand *MesosCommand_TriggerHook, err error, taskId string) *MesosCommandResponse_TriggerHook
type MesosCommandTarget ¶
type MesosCommandTarget struct { AgentId mesos.AgentID ExecutorId mesos.ExecutorID TaskId mesos.TaskID }
type MesosCommand_Transition ¶
type MesosCommand_Transition struct { MesosCommandBase Source string `json:"source"` Event string `json:"event"` Destination string `json:"destination"` }
func NewMesosCommand_Transition ¶
func NewMesosCommand_Transition(receivers []MesosCommandTarget, source string, event string, destination string, arguments PropertyMapsMap) *MesosCommand_Transition
func (*MesosCommand_Transition) MakeSingleTarget ¶
func (m *MesosCommand_Transition) MakeSingleTarget(target MesosCommandTarget) (cmd MesosCommand)
type MesosCommand_TriggerHook ¶ added in v0.16.0
type MesosCommand_TriggerHook struct {
MesosCommandBase
}
func NewMesosCommand_TriggerHook ¶ added in v0.16.0
func NewMesosCommand_TriggerHook(receivers []MesosCommandTarget) *MesosCommand_TriggerHook
func (*MesosCommand_TriggerHook) MakeSingleTarget ¶ added in v0.16.0
func (m *MesosCommand_TriggerHook) MakeSingleTarget(target MesosCommandTarget) (cmd MesosCommand)
type PropertyMap ¶
type PropertyMapsMap ¶
type PropertyMapsMap map[MesosCommandTarget]PropertyMap
type SendCommandFunc ¶
type SendCommandFunc func(command MesosCommand, receiver MesosCommandTarget) error
type Servent ¶
type Servent struct { SendFunc SendCommandFunc // contains filtered or unexported fields }
func NewServent ¶
func NewServent(commandFunc SendCommandFunc) *Servent
func (*Servent) ProcessResponse ¶
func (s *Servent) ProcessResponse(res MesosCommandResponse, sender MesosCommandTarget)
func (*Servent) RunCommand ¶
func (s *Servent) RunCommand(cmd MesosCommand, receiver MesosCommandTarget) (MesosCommandResponse, error)
Click to show internal directories.
Click to hide internal directories.