pod

package
v0.0.0-...-1d39891 Latest Latest
Warning

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

Go to latest
Published: May 12, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

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 Forwarder

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

func NewForwarder(host string, 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

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

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

func (*Forwarder) OnEdgeAdded

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

OnEdgeAdded graph edge added event. Implements the EventListener interface.

func (*Forwarder) OnEdgeDeleted

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

OnEdgeDeleted graph edge deleted event. Implements the EventListener interface.

func (*Forwarder) OnEdgeUpdated

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

OnEdgeUpdated graph edge updated event. Implements the EventListener interface.

func (*Forwarder) OnNewMaster

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

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

OnNodeAdded graph node added event. Implements the EventListener interface.

func (*Forwarder) OnNodeDeleted

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

OnNodeDeleted graph node deleted event. Implements the EventListener interface.

func (*Forwarder) OnNodeUpdated

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

OnNodeUpdated graph node updated event. Implements the EventListener interface.

type Opts

type Opts struct {
	ServerOpts websocket.ServerOpts
	Validator  validator.Validator
}

Opts defines pod server options

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, opts Opts) (*Pod, error)

NewPod returns a new pod

func (*Pod) Forwarder

func (p *Pod) Forwarder() *Forwarder

Forwarder returns the pod topology forwarder

func (*Pod) GetStatus

func (p *Pod) GetStatus() *Status

GetStatus returns the status of the pod

func (*Pod) Start

func (p *Pod) Start()

Start the pod

func (*Pod) Stop

func (p *Pod) Stop()

Stop the pod

func (*Pod) SubscriberServer

func (p *Pod) SubscriberServer() *websocket.StructServer

SubscriberServer returns the websocket server dedicated to subscribers

type PublisherEndpoint

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

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

NewPublisherEndpoint returns a new server for external publishers.

func (*PublisherEndpoint) OnStructMessage

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

OnStructMessage is triggered by message coming from a publisher.

type Status

type Status struct {
	Subscribers map[string]websocket.ConnStatus
	Hubs        map[string]ConnStatus
}

Status describes the status of a pod

Jump to

Keyboard shortcuts

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