server

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 17 Imported by: 2

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

This section is empty.

Types

type FlowServer

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

FlowServer describes a flow server

func NewFlowServer

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

func (s *FlowServer) Start()

Start the flow server

func (*FlowServer) Stop

func (s *FlowServer) Stop()

Stop the server

type FlowServerConn

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

FlowServerConn describes a flow server connection

type FlowServerUDPConn

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

FlowServerUDPConn describes a UDP flow server connection

func NewFlowServerUDPConn

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

NewFlowServerUDPConn return a new UDP flow server

func (*FlowServerUDPConn) Serve

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

Serve UDP connections

type FlowServerWebSocketConn

type FlowServerWebSocketConn struct {
	ws.DefaultSpeakerEventHandler
	// contains filtered or unexported fields
}

FlowServerWebSocketConn describes a WebSocket flow server connection

func NewFlowServerWebSocketConn

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

NewFlowServerWebSocketConn returns a new WebSocket flow server

func (*FlowServerWebSocketConn) OnMessage

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

OnMessage event

func (*FlowServerWebSocketConn) Serve

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

Serve starts a WebSocket flow server

type FlowSubscriberEndpoint

type FlowSubscriberEndpoint struct {
	insanelock.RWMutex
	// contains filtered or unexported fields
}

FlowSubscriberEndpoint sends all the flows to its subscribers.

func NewFlowSubscriberEndpoint

func NewFlowSubscriberEndpoint(srv *ws.StructServer) *FlowSubscriberEndpoint

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

func (*FlowSubscriberEndpoint) OnConnected added in v0.25.0

func (fs *FlowSubscriberEndpoint) OnConnected(c ws.Speaker) error

OnConnected Server interface

func (*FlowSubscriberEndpoint) OnDisconnected added in v0.25.0

func (fs *FlowSubscriberEndpoint) OnDisconnected(c ws.Speaker)

OnDisconnected Server interface

func (*FlowSubscriberEndpoint) OnMessage added in v0.25.0

func (fs *FlowSubscriberEndpoint) OnMessage(c ws.Speaker, m ws.Message)

OnMessage Server interface

func (*FlowSubscriberEndpoint) SendFlows

func (fs *FlowSubscriberEndpoint) SendFlows(flows []*flow.Flow)

SendFlows sends flow to the subscribers

func (*FlowSubscriberEndpoint) SendStats added in v0.26.0

func (fs *FlowSubscriberEndpoint) SendStats(stats *flow.Stats)

SendStats send stats to subscribers

Jump to

Keyboard shortcuts

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