endpoints

package
v0.0.0-...-b4bb62b Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Inhibitor

type Inhibitor interface {
	Inhib(ws.Speaker)
}

Inhibitor is used to disable graph events on a forwarder

type PersistencePolicy

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 PubSubEndpoint

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

PubSubEndpoint describes a WebSocket endpoint that can be used for both publishing and subscribing

func NewPubSubEndpoint

func NewPubSubEndpoint(pool ws.StructSpeakerPool, validator server.Validator, g *graph.Graph, tr *traversal.GremlinTraversalParser, logger logging.Logger) *PubSubEndpoint

NewPubSubEndpoint returns a new PubSub endpoint

type PublisherEndpoint

type PublisherEndpoint struct {
	insanelock.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

func NewPublisherEndpoint(pool ws.StructSpeakerPool, g *graph.Graph, validator server.Validator, logger logging.Logger, inhibitor Inhibitor) *PublisherEndpoint

NewPublisherEndpoint returns a new server for external publishers.

func (*PublisherEndpoint) OnDisconnected

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

OnDisconnected called when a publisher got disconnected.

func (*PublisherEndpoint) OnStructMessage

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

OnStructMessage is triggered by message coming from a publisher.

type ReplicationEndpoint

type ReplicationEndpoint struct {
	insanelock.RWMutex
	ws.DefaultSpeakerEventHandler

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

ReplicationEndpoint serves the local Graph and send local modification to its peers.

func NewReplicationEndpoint

func NewReplicationEndpoint(pool ws.StructSpeakerPool, opts *ws.ClientOpts, cached *graph.CachedBackend, g *graph.Graph, peers []service.Address, logger logging.Logger) *ReplicationEndpoint

NewReplicationEndpoint returns a new server to be used by other analyzers for replication.

func (*ReplicationEndpoint) ConnectPeers

func (t *ReplicationEndpoint) ConnectPeers()

ConnectPeers starts a goroutine connecting all the peers.

func (*ReplicationEndpoint) DisconnectPeers

func (t *ReplicationEndpoint) DisconnectPeers()

DisconnectPeers disconnects all the peers and wait until all disconnected.

func (*ReplicationEndpoint) GetIncomingSpeakers

func (t *ReplicationEndpoint) GetIncomingSpeakers() []ws.Speaker

GetIncomingSpeakers return incoming speakers

func (*ReplicationEndpoint) GetOutgoingSpeakers

func (t *ReplicationEndpoint) GetOutgoingSpeakers() []ws.Speaker

GetOutgoingSpeakers return outgoing speakers

func (*ReplicationEndpoint) GetSpeakers

func (t *ReplicationEndpoint) GetSpeakers() []ws.Speaker

GetSpeakers return both incoming and outgoing speakers

func (*ReplicationEndpoint) OnConnected

func (t *ReplicationEndpoint) OnConnected(c ws.Speaker) error

OnConnected is called when an incoming peer got connected.

func (*ReplicationEndpoint) OnDisconnected

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

OnDisconnected is called when an incoming peer got disconnected.

func (*ReplicationEndpoint) OnEdgeAdded

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

OnEdgeAdded graph edge added event. Implements the EventListener interface.

func (*ReplicationEndpoint) OnEdgeDeleted

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

OnEdgeDeleted graph edge deleted event. Implements the EventListener interface.

func (*ReplicationEndpoint) OnEdgeUpdated

func (t *ReplicationEndpoint) OnEdgeUpdated(e *graph.Edge, ops []graph.PartiallyUpdatedOp)

OnEdgeUpdated graph edge updated event. Implements the EventListener interface.

func (*ReplicationEndpoint) OnNodeAdded

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

OnNodeAdded graph node added event. Implements the EventListener interface.

func (*ReplicationEndpoint) OnNodeDeleted

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

OnNodeDeleted graph node deleted event. Implements the EventListener interface.

func (*ReplicationEndpoint) OnNodeUpdated

func (t *ReplicationEndpoint) OnNodeUpdated(n *graph.Node, ops []graph.PartiallyUpdatedOp)

OnNodeUpdated graph node updated event. Implements the EventListener interface.

func (*ReplicationEndpoint) OnStructMessage

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

OnStructMessage is triggered by message coming from an other peer.

type ReplicatorPeer

type ReplicatorPeer struct {
	ws.DefaultSpeakerEventHandler
	URL   *url.URL
	Graph *graph.Graph
	// contains filtered or unexported fields
}

ReplicatorPeer is a remote connection to another Graph server. Only modification of the local Graph made either by the local server, by an agent message or by an external client will be forwarded to the peer.

func (*ReplicatorPeer) OnConnected

func (p *ReplicatorPeer) OnConnected(c ws.Speaker) error

OnConnected is called when the peer gets connected then the whole graph is send to initialize it.

func (*ReplicatorPeer) OnDisconnected

func (p *ReplicatorPeer) OnDisconnected(c ws.Speaker)

OnDisconnected is called when the peer gets disconnected

type SubscriberEndpoint

type SubscriberEndpoint struct {
	insanelock.RWMutex
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

SubscriberEndpoint sends all the modifications to its subscribers.

func NewSubscriberEndpoint

func NewSubscriberEndpoint(pool ws.StructSpeakerPool, g *graph.Graph, tr *traversal.GremlinTraversalParser, logger logging.Logger) *SubscriberEndpoint

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

func (*SubscriberEndpoint) Inhib

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

Inhib node and edge forwarding

func (*SubscriberEndpoint) OnConnected

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

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, ops []graph.PartiallyUpdatedOp)

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, ops []graph.PartiallyUpdatedOp)

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

type UpdatePolicy

type UpdatePolicy = string

UpdatePolicy specifies whether we should send partial or full updates

const (
	FullUpdates    UpdatePolicy = "full"
	PartialUpdates              = "partial"
)

Update policies

Jump to

Keyboard shortcuts

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