Documentation ¶
Index ¶
- type ConnStatus
- type Pod
- type Status
- type TopologyForwarder
- func (t *TopologyForwarder) GetMaster() ws.Speaker
- func (t *TopologyForwarder) OnEdgeAdded(e *graph.Edge)
- func (t *TopologyForwarder) OnEdgeDeleted(e *graph.Edge)
- func (t *TopologyForwarder) OnEdgeUpdated(e *graph.Edge)
- func (t *TopologyForwarder) OnNewMaster(c ws.Speaker)
- func (t *TopologyForwarder) OnNodeAdded(n *graph.Node)
- func (t *TopologyForwarder) OnNodeDeleted(n *graph.Node)
- func (t *TopologyForwarder) OnNodeUpdated(n *graph.Node)
- type TopologySubscriberEndpoint
- func (t *TopologySubscriberEndpoint) OnConnected(c ws.Speaker)
- func (t *TopologySubscriberEndpoint) OnDisconnected(c ws.Speaker)
- func (t *TopologySubscriberEndpoint) OnEdgeAdded(e *graph.Edge)
- func (t *TopologySubscriberEndpoint) OnEdgeDeleted(e *graph.Edge)
- func (t *TopologySubscriberEndpoint) OnEdgeUpdated(e *graph.Edge)
- func (t *TopologySubscriberEndpoint) OnNodeAdded(n *graph.Node)
- func (t *TopologySubscriberEndpoint) OnNodeDeleted(n *graph.Node)
- func (t *TopologySubscriberEndpoint) OnNodeUpdated(n *graph.Node)
- func (t *TopologySubscriberEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConnStatus ¶
type ConnStatus struct { websocket.ConnStatus IsMaster bool }
ConnStatus represents the status of a connection to a hub
type Pod ¶
type Pod struct {
// contains filtered or unexported fields
}
Pod describes a graph pod. It maintains a local graph in memory and forward any event to graph hubs
func NewPod ¶
func NewPod(server *api.Server, clientPool *websocket.StructClientPool, g *graph.Graph, apiAuthBackend shttp.AuthenticationBackend, clusterAuthOptions *shttp.AuthenticationOpts, tr *traversal.GremlinTraversalParser, writeCompression bool, queueSize int, pingDelay, pongTimeout time.Duration) (*Pod, error)
NewPod returns a new pod
func (*Pod) SubscriberServer ¶
func (p *Pod) SubscriberServer() *websocket.StructServer
SubscriberServer returns the websocket server dedicated to subscribers
func (*Pod) TopologyForwarder ¶
func (p *Pod) TopologyForwarder() *TopologyForwarder
TopologyForwarder returns the pod topology forwarder
type Status ¶
type Status struct { Subscribers map[string]websocket.ConnStatus Hubs map[string]ConnStatus }
Status describes the status of a pod
type TopologyForwarder ¶
type TopologyForwarder struct {
// contains filtered or unexported fields
}
TopologyForwarder forwards the topology to only one master server. When switching from one analyzer to another one the agent does a full re-sync since some messages could have been lost.
func NewTopologyForwarder ¶
func NewTopologyForwarder(host string, g *graph.Graph, pool ws.StructSpeakerPool) *TopologyForwarder
NewTopologyForwarder returns a new Graph forwarder which forwards event of the given graph to the given WebSocket JSON speakers.
func (*TopologyForwarder) GetMaster ¶
func (t *TopologyForwarder) GetMaster() ws.Speaker
GetMaster returns the current analyzer the agent is sending its events to
func (*TopologyForwarder) OnEdgeAdded ¶
func (t *TopologyForwarder) OnEdgeAdded(e *graph.Edge)
OnEdgeAdded graph edge added event. Implements the EventListener interface.
func (*TopologyForwarder) OnEdgeDeleted ¶
func (t *TopologyForwarder) OnEdgeDeleted(e *graph.Edge)
OnEdgeDeleted graph edge deleted event. Implements the EventListener interface.
func (*TopologyForwarder) OnEdgeUpdated ¶
func (t *TopologyForwarder) OnEdgeUpdated(e *graph.Edge)
OnEdgeUpdated graph edge updated event. Implements the EventListener interface.
func (*TopologyForwarder) OnNewMaster ¶
func (t *TopologyForwarder) OnNewMaster(c ws.Speaker)
OnNewMaster is called by the master election mechanism when a new master is elected. In such case a "Re-sync" is triggered in order to be in sync with the new master.
func (*TopologyForwarder) OnNodeAdded ¶
func (t *TopologyForwarder) OnNodeAdded(n *graph.Node)
OnNodeAdded graph node added event. Implements the EventListener interface.
func (*TopologyForwarder) OnNodeDeleted ¶
func (t *TopologyForwarder) OnNodeDeleted(n *graph.Node)
OnNodeDeleted graph node deleted event. Implements the EventListener interface.
func (*TopologyForwarder) OnNodeUpdated ¶
func (t *TopologyForwarder) OnNodeUpdated(n *graph.Node)
OnNodeUpdated graph node updated event. Implements the EventListener interface.
type TopologySubscriberEndpoint ¶
type TopologySubscriberEndpoint struct { common.RWMutex ws.DefaultSpeakerEventHandler Graph *graph.Graph // contains filtered or unexported fields }
TopologySubscriberEndpoint sends all the modifications to its subscribers.
func NewTopologySubscriberEndpoint ¶
func NewTopologySubscriberEndpoint(pool ws.StructSpeakerPool, g *graph.Graph, tr *traversal.GremlinTraversalParser) *TopologySubscriberEndpoint
NewTopologySubscriberEndpoint returns a new server to be used by external subscribers, for instance the WebUI.
func (*TopologySubscriberEndpoint) OnConnected ¶
func (t *TopologySubscriberEndpoint) OnConnected(c ws.Speaker)
OnConnected called when a subscriber got connected.
func (*TopologySubscriberEndpoint) OnDisconnected ¶
func (t *TopologySubscriberEndpoint) OnDisconnected(c ws.Speaker)
OnDisconnected called when a subscriber got disconnected.
func (*TopologySubscriberEndpoint) OnEdgeAdded ¶
func (t *TopologySubscriberEndpoint) OnEdgeAdded(e *graph.Edge)
OnEdgeAdded graph edge added event. Implements the GraphEventListener interface.
func (*TopologySubscriberEndpoint) OnEdgeDeleted ¶
func (t *TopologySubscriberEndpoint) OnEdgeDeleted(e *graph.Edge)
OnEdgeDeleted graph edge deleted event. Implements the GraphEventListener interface.
func (*TopologySubscriberEndpoint) OnEdgeUpdated ¶
func (t *TopologySubscriberEndpoint) OnEdgeUpdated(e *graph.Edge)
OnEdgeUpdated graph edge updated event. Implements the GraphEventListener interface.
func (*TopologySubscriberEndpoint) OnNodeAdded ¶
func (t *TopologySubscriberEndpoint) OnNodeAdded(n *graph.Node)
OnNodeAdded graph node added event. Implements the GraphEventListener interface.
func (*TopologySubscriberEndpoint) OnNodeDeleted ¶
func (t *TopologySubscriberEndpoint) OnNodeDeleted(n *graph.Node)
OnNodeDeleted graph node deleted event. Implements the GraphEventListener interface.
func (*TopologySubscriberEndpoint) OnNodeUpdated ¶
func (t *TopologySubscriberEndpoint) OnNodeUpdated(n *graph.Node)
OnNodeUpdated graph node updated event. Implements the GraphEventListener interface.
func (*TopologySubscriberEndpoint) OnStructMessage ¶
func (t *TopologySubscriberEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)
OnStructMessage is triggered when receiving a message from a subscriber. It only responds to SyncRequestMsgType messages