common

package
v0.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientOrigin added in v0.26.0

func ClientOrigin(c websocket.Speaker) string

ClientOrigin return a string identifying a client using its service type and host id

func DelSubGraphOfOrigin added in v0.26.0

func DelSubGraphOfOrigin(g *graph.Graph, origin string)

DelSubGraphOfOrigin deletes all the nodes with a specified origin

Types

type Forwarder added in v0.26.0

type Forwarder struct {
	// contains filtered or unexported fields
}

Forwarder 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 NewForwarder added in v0.26.0

func NewForwarder(g *graph.Graph, pool ws.StructSpeakerPool) *Forwarder

NewForwarder returns a new Graph forwarder which forwards event of the given graph to the given WebSocket JSON speakers.

func (*Forwarder) GetMaster added in v0.26.0

func (t *Forwarder) GetMaster() ws.Speaker

GetMaster returns the current analyzer the agent is sending its events to

func (*Forwarder) OnEdgeAdded added in v0.26.0

func (t *Forwarder) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded graph edge added event. Implements the EventListener interface.

func (*Forwarder) OnEdgeDeleted added in v0.26.0

func (t *Forwarder) OnEdgeDeleted(e *graph.Edge)

OnEdgeDeleted graph edge deleted event. Implements the EventListener interface.

func (*Forwarder) OnEdgeUpdated added in v0.26.0

func (t *Forwarder) OnEdgeUpdated(e *graph.Edge)

OnEdgeUpdated graph edge updated event. Implements the EventListener interface.

func (*Forwarder) OnNewMaster added in v0.26.0

func (t *Forwarder) 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 (*Forwarder) OnNodeAdded added in v0.26.0

func (t *Forwarder) OnNodeAdded(n *graph.Node)

OnNodeAdded graph node added event. Implements the EventListener interface.

func (*Forwarder) OnNodeDeleted added in v0.26.0

func (t *Forwarder) OnNodeDeleted(n *graph.Node)

OnNodeDeleted graph node deleted event. Implements the EventListener interface.

func (*Forwarder) OnNodeUpdated added in v0.26.0

func (t *Forwarder) OnNodeUpdated(n *graph.Node)

OnNodeUpdated graph node updated event. Implements the EventListener interface.

type PersistencePolicy added in v0.26.0

type PersistencePolicy string

PersistencePolicy defines Persistent policy for publishers

const (
	// Persistent means that the graph elements created will always remain
	Persistent PersistencePolicy = "Persistent"
	// DeleteOnDisconnect means the graph elements created will be deleted on client disconnect
	DeleteOnDisconnect PersistencePolicy = "DeleteOnDisconnect"
)

type PublisherEndpoint added in v0.26.0

type PublisherEndpoint struct {
	common.RWMutex
	ws.DefaultSpeakerEventHandler

	Graph *graph.Graph
	// contains filtered or unexported fields
}

PublisherEndpoint serves the graph for external publishers, for instance an external program that interacts with the Skydive graph.

func NewPublisherEndpoint added in v0.26.0

func NewPublisherEndpoint(pool ws.StructSpeakerPool, g *graph.Graph, validator validator.Validator) (*PublisherEndpoint, error)

NewPublisherEndpoint returns a new server for external publishers.

func (*PublisherEndpoint) OnDisconnected added in v0.26.0

func (t *PublisherEndpoint) OnDisconnected(c ws.Speaker)

OnDisconnected called when a publisher got disconnected.

func (*PublisherEndpoint) OnStructMessage added in v0.26.0

func (t *PublisherEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)

OnStructMessage is triggered by message coming from a publisher.

type SubscriberEndpoint

type SubscriberEndpoint struct {
	common.RWMutex
	ws.DefaultSpeakerEventHandler

	Graph *graph.Graph
	// contains filtered or unexported fields
}

SubscriberEndpoint sends all the modifications to its subscribers.

func NewSubscriberEndpoint

NewSubscriberEndpoint returns a new server to be used by external subscribers, for instance the WebUI.

func (*SubscriberEndpoint) OnConnected

func (t *SubscriberEndpoint) OnConnected(c ws.Speaker)

OnConnected called when a subscriber got connected.

func (*SubscriberEndpoint) OnDisconnected

func (t *SubscriberEndpoint) OnDisconnected(c ws.Speaker)

OnDisconnected called when a subscriber got disconnected.

func (*SubscriberEndpoint) OnEdgeAdded

func (t *SubscriberEndpoint) OnEdgeAdded(e *graph.Edge)

OnEdgeAdded graph edge added event. Implements the GraphEventListener interface.

func (*SubscriberEndpoint) OnEdgeDeleted

func (t *SubscriberEndpoint) OnEdgeDeleted(e *graph.Edge)

OnEdgeDeleted graph edge deleted event. Implements the GraphEventListener interface.

func (*SubscriberEndpoint) OnEdgeUpdated

func (t *SubscriberEndpoint) OnEdgeUpdated(e *graph.Edge)

OnEdgeUpdated graph edge updated event. Implements the GraphEventListener interface.

func (*SubscriberEndpoint) OnNodeAdded

func (t *SubscriberEndpoint) OnNodeAdded(n *graph.Node)

OnNodeAdded graph node added event. Implements the GraphEventListener interface.

func (*SubscriberEndpoint) OnNodeDeleted

func (t *SubscriberEndpoint) OnNodeDeleted(n *graph.Node)

OnNodeDeleted graph node deleted event. Implements the GraphEventListener interface.

func (*SubscriberEndpoint) OnNodeUpdated

func (t *SubscriberEndpoint) OnNodeUpdated(n *graph.Node)

OnNodeUpdated graph node updated event. Implements the GraphEventListener interface.

func (*SubscriberEndpoint) OnStructMessage

func (t *SubscriberEndpoint) OnStructMessage(c ws.Speaker, msg *ws.StructMessage)

OnStructMessage is triggered when receiving a message from a subscriber. It only responds to SyncRequestMsgType messages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL