analyzer

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 39 Imported by: 16

Documentation

Index

Constants

View Source
const FlowBulkInsertDeadlineDefault int = 5

FlowBulkDeadlineDefault deadline of each bulk insert in second

View Source
const FlowBulkInsertDefault int = 100

FlowBulkInsertDefault maximum number of flows aggregated between two data store inserts

Variables

This section is empty.

Functions

func NewAnalyzerAuthenticationOpts added in v0.13.0

func NewAnalyzerAuthenticationOpts() *shttp.AuthenticationOpts

NewAnalyzerAuthenticationOpts returns an object to authenticate to the analyzer

func NewTopologyProbeBundleFromConfig added in v0.8.0

func NewTopologyProbeBundleFromConfig(g *graph.Graph) (*probe.ProbeBundle, error)

NewTopologyProbeBundleFromConfig creates a new topology server probes from configuration

Types

type FlowClient added in v0.10.0

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

FlowClient describes a flow client connection

func NewFlowClient added in v0.10.0

func NewFlowClient(addr string, port int) (*FlowClient, error)

NewFlowClient creates a flow client and creates a new connection to the server

func (*FlowClient) SendFlow added in v0.10.0

func (c *FlowClient) SendFlow(f *flow.Flow) error

SendFlow sends a flow to the server

func (*FlowClient) SendFlows added in v0.10.0

func (c *FlowClient) SendFlows(flows []*flow.Flow)

SendFlows sends flows to the server

type FlowClientConn added in v0.10.0

type FlowClientConn interface {
	Connect() error
	Close() error
	Send(data []byte) error
}

FlowClientConn is the interface to be implemented by the flow clients

type FlowClientPool added in v0.10.0

type FlowClientPool struct {
	common.RWMutex
	shttp.DefaultWSSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowClientPool describes a flow client pool.

func NewFlowClientPool added in v0.10.0

func NewFlowClientPool(pool shttp.WSSpeakerPool) *FlowClientPool

NewFlowClientPool returns a new FlowClientPool using the websocket connections to maintain the pool of client up to date according to the websocket connections status.

func (*FlowClientPool) Close added in v0.10.0

func (p *FlowClientPool) Close()

Close all connections

func (*FlowClientPool) OnConnected added in v0.10.0

func (p *FlowClientPool) OnConnected(c shttp.WSSpeaker)

OnConnected websocket event handler

func (*FlowClientPool) OnDisconnected added in v0.10.0

func (p *FlowClientPool) OnDisconnected(c shttp.WSSpeaker)

OnDisconnected websocket event handler

func (*FlowClientPool) SendFlows added in v0.10.0

func (p *FlowClientPool) SendFlows(flows []*flow.Flow)

SendFlows sends flows using a random connection

type FlowClientUDPConn added in v0.13.0

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

FlowClientUDPConn describes UDP client connection

func NewFlowClientUDPConn added in v0.13.0

func NewFlowClientUDPConn(addr string, port int) (*FlowClientUDPConn, error)

NewFlowClientUDPConn returns a new UDP flow client

func (*FlowClientUDPConn) Close added in v0.13.0

func (c *FlowClientUDPConn) Close() error

Close the connection

func (*FlowClientUDPConn) Connect added in v0.13.0

func (c *FlowClientUDPConn) Connect() (err error)

Connect to the UDP flow server

func (*FlowClientUDPConn) Send added in v0.13.0

func (c *FlowClientUDPConn) Send(data []byte) error

Send data over the wire

type FlowClientWebSocketConn added in v0.13.0

type FlowClientWebSocketConn struct {
	shttp.DefaultWSSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowClientWebSocketConn describes WebSocket client connection

func NewFlowClientWebSocketConn added in v0.13.0

func NewFlowClientWebSocketConn(url *url.URL) (*FlowClientWebSocketConn, error)

NewFlowClientWebSocketConn returns a new WebSocket flow client

func (*FlowClientWebSocketConn) Close added in v0.13.0

func (c *FlowClientWebSocketConn) Close() error

Close the connection

func (*FlowClientWebSocketConn) Connect added in v0.13.0

func (c *FlowClientWebSocketConn) Connect() error

Connect to the WebSocket flow server

func (*FlowClientWebSocketConn) Send added in v0.13.0

func (c *FlowClientWebSocketConn) Send(data []byte) error

Send data over the wire

type FlowServer added in v0.10.0

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

FlowServer describes a flow server with pipeline enhancers mechanism

func NewFlowServer added in v0.10.0

func NewFlowServer(s *shttp.Server, g *graph.Graph, store storage.Storage, probe *probe.ProbeBundle) (*FlowServer, error)

NewFlowServer creates a new flow server listening at address/port, based on configuration

func (*FlowServer) Start added in v0.10.0

func (s *FlowServer) Start()

Start the flow server

func (*FlowServer) Stop added in v0.10.0

func (s *FlowServer) Stop()

Stop the server

type FlowServerConn added in v0.10.0

type FlowServerConn interface {
	Serve(ch chan *flow.Flow, quit chan struct{}, wg *sync.WaitGroup)
}

FlowServerConn describes a flow server connection

type FlowServerUDPConn added in v0.13.0

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

FlowServerConn describes a UDP flow server connection

func NewFlowServerUDPConn added in v0.13.0

func NewFlowServerUDPConn(addr string, port int) (*FlowServerUDPConn, error)

NewFlowServerUDPConn return a new UDP flow server

func (*FlowServerUDPConn) Serve added in v0.13.0

func (c *FlowServerUDPConn) Serve(ch chan *flow.Flow, quit chan struct{}, wg *sync.WaitGroup)

Serve UDP connections

type FlowServerWebSocketConn added in v0.13.0

type FlowServerWebSocketConn struct {
	shttp.DefaultWSSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowServerConn describes a WebSocket flow server connection

func NewFlowServerWebSocketConn added in v0.13.0

func NewFlowServerWebSocketConn(server *shttp.Server) (*FlowServerWebSocketConn, error)

NewFlowServerWebSocketConn returns a new WebSocket flow server

func (*FlowServerWebSocketConn) OnMessage added in v0.13.0

func (c *FlowServerWebSocketConn) OnMessage(client shttp.WSSpeaker, m shttp.WSMessage)

OnMessage event

func (*FlowServerWebSocketConn) Serve added in v0.13.0

func (c *FlowServerWebSocketConn) Serve(ch chan *flow.Flow, quit chan struct{}, wg *sync.WaitGroup)

Start a WebSocket flow server

type PersistencePolicy added in v0.15.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 Server

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

Server describes an Analyzer servers mechanism like http, websocket, topology, ondemand probes, ...

func NewServerFromConfig

func NewServerFromConfig() (*Server, error)

NewServerFromConfig creates a new empty server

func (*Server) GetStatus added in v0.13.0

func (s *Server) GetStatus() interface{}

GetStatus returns the status of an analyzer

func (*Server) Start added in v0.10.0

func (s *Server) Start() error

Start the analyzer server

func (*Server) Stop

func (s *Server) Stop()

Stop the analyzer server

type TopologyAgentEndpoint added in v0.15.0

type TopologyAgentEndpoint struct {
	common.RWMutex
	shttp.DefaultWSSpeakerEventHandler

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

TopologyAgentEndpoint serves the graph for agents.

func NewTopologyAgentEndpoint added in v0.15.0

func NewTopologyAgentEndpoint(pool shttp.WSStructSpeakerPool, auth *shttp.AuthenticationOpts, cached *graph.CachedBackend, g *graph.Graph) (*TopologyAgentEndpoint, error)

NewTopologyAgentEndpoint returns a new server that handles messages from the agents

func (*TopologyAgentEndpoint) OnDisconnected added in v0.15.0

func (t *TopologyAgentEndpoint) OnDisconnected(c shttp.WSSpeaker)

OnDisconnected called when an agent disconnected.

func (*TopologyAgentEndpoint) OnWSStructMessage added in v0.17.0

func (t *TopologyAgentEndpoint) OnWSStructMessage(c shttp.WSSpeaker, msg *shttp.WSStructMessage)

OnWSStructMessage is triggered when a message from the agent is received.

type TopologyPublisherEndpoint added in v0.15.0

type TopologyPublisherEndpoint struct {
	common.RWMutex
	shttp.DefaultWSSpeakerEventHandler

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

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

func NewTopologyPublisherEndpoint added in v0.15.0

func NewTopologyPublisherEndpoint(pool shttp.WSStructSpeakerPool, auth *shttp.AuthenticationOpts, g *graph.Graph) (*TopologyPublisherEndpoint, error)

NewTopologyPublisherEndpoint returns a new server for external publishers.

func (*TopologyPublisherEndpoint) OnDisconnected added in v0.15.0

func (t *TopologyPublisherEndpoint) OnDisconnected(c shttp.WSSpeaker)

OnDisconnected called when a publisher got disconnected.

func (*TopologyPublisherEndpoint) OnWSStructMessage added in v0.17.0

func (t *TopologyPublisherEndpoint) OnWSStructMessage(c shttp.WSSpeaker, msg *shttp.WSStructMessage)

OnWSStructMessage is triggered by message coming from a publisher.

type TopologyReplicationEndpoint added in v0.15.0

type TopologyReplicationEndpoint struct {
	common.RWMutex
	shttp.DefaultWSSpeakerEventHandler

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

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

func NewTopologyReplicationEndpoint added in v0.15.0

func NewTopologyReplicationEndpoint(pool shttp.WSStructSpeakerPool, auth *shttp.AuthenticationOpts, cached *graph.CachedBackend, g *graph.Graph) (*TopologyReplicationEndpoint, error)

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

func (*TopologyReplicationEndpoint) ConnectPeers added in v0.15.0

func (t *TopologyReplicationEndpoint) ConnectPeers()

ConnectPeers starts a goroutine connecting all the peers.

func (*TopologyReplicationEndpoint) DisconnectPeers added in v0.15.0

func (t *TopologyReplicationEndpoint) DisconnectPeers()

DisconnectPeers disconnects all the peers and wait until all disconnected.

func (*TopologyReplicationEndpoint) GetSpeakers added in v0.15.0

func (t *TopologyReplicationEndpoint) GetSpeakers() []shttp.WSSpeaker

func (*TopologyReplicationEndpoint) OnConnected added in v0.15.0

func (t *TopologyReplicationEndpoint) OnConnected(c shttp.WSSpeaker)

OnConnected is called when an incoming peer got connected.

func (*TopologyReplicationEndpoint) OnDisconnected added in v0.15.0

func (t *TopologyReplicationEndpoint) OnDisconnected(c shttp.WSSpeaker)

OnDisconnected is called when an incoming peer got disconnected.

func (*TopologyReplicationEndpoint) OnEdgeAdded added in v0.15.0

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

OnEdgeAdded graph edge added event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnEdgeDeleted added in v0.15.0

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

OnEdgeDeleted graph edge deleted event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnEdgeUpdated added in v0.15.0

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

OnEdgeUpdated graph edge updated event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnNodeAdded added in v0.15.0

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

OnNodeAdded graph node added event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnNodeDeleted added in v0.15.0

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

OnNodeDeleted graph node deleted event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnNodeUpdated added in v0.15.0

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

OnNodeUpdated graph node updated event. Implements the GraphEventListener interface.

func (*TopologyReplicationEndpoint) OnWSStructMessage added in v0.17.0

func (t *TopologyReplicationEndpoint) OnWSStructMessage(c shttp.WSSpeaker, msg *shttp.WSStructMessage)

OnWSStructMessage is triggered by message coming from an other peer.

type TopologyReplicatorPeer added in v0.13.0

type TopologyReplicatorPeer struct {
	shttp.DefaultWSSpeakerEventHandler
	URL         *url.URL
	Graph       *graph.Graph
	AuthOptions *shttp.AuthenticationOpts
	// contains filtered or unexported fields
}

TopologyReplicatorPeer 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 (*TopologyReplicatorPeer) OnConnected added in v0.13.0

func (p *TopologyReplicatorPeer) OnConnected(c shttp.WSSpeaker)

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

func (*TopologyReplicatorPeer) OnDisconnected added in v0.15.0

func (p *TopologyReplicatorPeer) OnDisconnected(c shttp.WSSpeaker)

OnConnected is called when the peer gets Disconnected

Jump to

Keyboard shortcuts

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