pod

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2019 License: Apache-2.0 Imports: 12 Imported by: 4

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 added in v0.23.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.23.0

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 added in v0.23.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.23.0

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

OnEdgeAdded graph edge added event. Implements the EventListener interface.

func (*Forwarder) OnEdgeDeleted added in v0.23.0

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

OnEdgeDeleted graph edge deleted event. Implements the EventListener interface.

func (*Forwarder) OnEdgeUpdated added in v0.23.0

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

OnEdgeUpdated graph edge updated event. Implements the EventListener interface.

func (*Forwarder) OnNewMaster added in v0.23.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.23.0

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

OnNodeAdded graph node added event. Implements the EventListener interface.

func (*Forwarder) OnNodeDeleted added in v0.23.0

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

OnNodeDeleted graph node deleted event. Implements the EventListener interface.

func (*Forwarder) OnNodeUpdated added in v0.23.0

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

OnNodeUpdated graph node updated event. Implements the EventListener interface.

type Opts added in v0.23.0

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 added in v0.23.0

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 added in v0.23.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.23.0

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

NewPublisherEndpoint returns a new server for external publishers.

func (*PublisherEndpoint) OnStructMessage added in v0.23.0

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