Documentation ¶
Index ¶
- type OnDemandClient
- func (o *OnDemandClient) OnEdgeAdded(e *graph.Edge)
- func (o *OnDemandClient) OnNodeAdded(n *graph.Node)
- func (o *OnDemandClient) OnNodeDeleted(n *graph.Node)
- func (o *OnDemandClient) OnNodeUpdated(n *graph.Node)
- func (o *OnDemandClient) OnStartAsMaster()
- func (o *OnDemandClient) OnStartAsSlave()
- func (o *OnDemandClient) OnStructMessage(c ws.Speaker, m *ws.StructMessage)
- func (o *OnDemandClient) OnSwitchToMaster()
- func (o *OnDemandClient) OnSwitchToSlave()
- func (o *OnDemandClient) Start()
- func (o *OnDemandClient) Stop()
- type OnDemandClientHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnDemandClient ¶
type OnDemandClient struct { common.RWMutex common.MasterElection graph.DefaultGraphListener // contains filtered or unexported fields }
OnDemandClient describes an ondemand task client based on a websocket
func NewOnDemandClient ¶
func NewOnDemandClient(g *graph.Graph, ch api.Handler, agentPool ws.StructSpeakerPool, subscriberPool ws.StructSpeakerPool, etcdClient *etcd.Client, handler OnDemandClientHandler) *OnDemandClient
NewOnDemandClient creates a new ondemand task client based on API, graph and websocket
func (*OnDemandClient) OnEdgeAdded ¶
func (o *OnDemandClient) OnEdgeAdded(e *graph.Edge)
OnEdgeAdded graph event
func (*OnDemandClient) OnNodeAdded ¶
func (o *OnDemandClient) OnNodeAdded(n *graph.Node)
OnNodeAdded graph event
func (*OnDemandClient) OnNodeDeleted ¶
func (o *OnDemandClient) OnNodeDeleted(n *graph.Node)
OnNodeDeleted graph event
func (*OnDemandClient) OnNodeUpdated ¶
func (o *OnDemandClient) OnNodeUpdated(n *graph.Node)
OnNodeUpdated graph event
func (*OnDemandClient) OnStartAsMaster ¶
func (o *OnDemandClient) OnStartAsMaster()
OnStartAsMaster event
func (*OnDemandClient) OnStartAsSlave ¶
func (o *OnDemandClient) OnStartAsSlave()
OnStartAsSlave event
func (*OnDemandClient) OnStructMessage ¶
func (o *OnDemandClient) OnStructMessage(c ws.Speaker, m *ws.StructMessage)
OnStructMessage event, valid message type: StartReply or StopReply message
func (*OnDemandClient) OnSwitchToMaster ¶
func (o *OnDemandClient) OnSwitchToMaster()
OnSwitchToMaster event
func (*OnDemandClient) OnSwitchToSlave ¶
func (o *OnDemandClient) OnSwitchToSlave()
OnSwitchToSlave event
type OnDemandClientHandler ¶
type OnDemandClientHandler interface { ResourceName() string GetNodes(resource types.Resource) []interface{} CheckState(n *graph.Node, resource types.Resource) bool DecodeMessage(msg json.RawMessage) (types.Resource, error) EncodeMessage(nodeID graph.Identifier, resource types.Resource) (json.RawMessage, error) }
OnDemandClientHandler is the interface to be implemented by ondemand clients
Click to show internal directories.
Click to hide internal directories.