analyzer

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: Apache-2.0 Imports: 43 Imported by: 16

Documentation

Index

Constants

View Source
const (
	// FlowBulkInsertDefault maximum number of flows aggregated between two data store inserts
	FlowBulkInsertDefault int = 100

	// FlowBulkInsertDeadlineDefault deadline of each bulk insert in second
	FlowBulkInsertDeadlineDefault int = 5

	// FlowBulkMaxDelayDefault delay between two bulk
	FlowBulkMaxDelayDefault int = 5
)

Variables

This section is empty.

Functions

func ClusterAuthenticationOpts added in v0.21.0

func ClusterAuthenticationOpts() *shttp.AuthenticationOpts

ClusterAuthenticationOpts returns auth info to connect to an analyzer from the configuration

func NewESConfig added in v0.22.0

func NewESConfig(name ...string) es.Config

NewESConfig returns a new elasticsearch configuration for the given backend name

func NewTopologyProbeBundleFromConfig added in v0.8.0

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

NewTopologyProbeBundleFromConfig creates a new topology server probes from configuration

Types

type ElectionStatus added in v0.13.0

type ElectionStatus struct {
	IsMaster bool
}

ElectionStatus describes the status of an election

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, authOpts *shttp.AuthenticationOpts) (*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(flowArray *flow.FlowArray)

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
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowClientPool describes a flow client pool.

func NewFlowClientPool added in v0.10.0

func NewFlowClientPool(pool ws.SpeakerPool, authOpts *shttp.AuthenticationOpts) *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 ws.Speaker)

OnConnected websocket event handler

func (*FlowClientPool) OnDisconnected added in v0.10.0

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

OnDisconnected websocket event handler

func (*FlowClientPool) SendFlows added in v0.10.0

func (p *FlowClientPool) SendFlows(flowArray *flow.FlowArray)

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 {
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowClientWebSocketConn describes WebSocket client connection

func NewFlowClientWebSocketConn added in v0.13.0

func NewFlowClientWebSocketConn(url *url.URL, authOpts *shttp.AuthenticationOpts) (*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() (err 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

func NewFlowServer added in v0.10.0

func NewFlowServer(s *shttp.Server, g *graph.Graph, store storage.Storage, endpoint *FlowSubscriberEndpoint, probe *probe.Bundle, auth shttp.AuthenticationBackend) (*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
}

FlowServerUDPConn 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 {
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowServerWebSocketConn describes a WebSocket flow server connection

func NewFlowServerWebSocketConn added in v0.13.0

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

NewFlowServerWebSocketConn returns a new WebSocket flow server

func (*FlowServerWebSocketConn) OnMessage added in v0.13.0

func (c *FlowServerWebSocketConn) OnMessage(client ws.Speaker, m ws.Message)

OnMessage event

func (*FlowServerWebSocketConn) Serve added in v0.13.0

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

Serve starts a WebSocket flow server

type FlowSubscriberEndpoint added in v0.21.0

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

FlowSubscriberEndpoint sends all the flows to its subscribers.

func NewFlowSubscriberEndpoint added in v0.21.0

func NewFlowSubscriberEndpoint(pool ws.StructSpeakerPool) *FlowSubscriberEndpoint

NewFlowSubscriberEndpoint returns a new server to be used by external flow subscribers

func (*FlowSubscriberEndpoint) SendFlows added in v0.21.0

func (fs *FlowSubscriberEndpoint) SendFlows(flowArray *flow.FlowArray)

SendFlows sends flow to the subscribers

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

type Status struct {
	Agents      map[string]ws.ConnStatus
	Peers       hub.PeersStatus
	Publishers  map[string]ws.ConnStatus
	Subscribers map[string]ws.ConnStatus
	Alerts      ElectionStatus
	Captures    ElectionStatus
	Probes      []string
}

Status describes the status of an analyzer

Jump to

Keyboard shortcuts

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