Documentation
¶
Index ¶
- Constants
- type FlowServer
- type FlowServerConn
- type FlowServerUDPConn
- type FlowServerWebSocketConn
- type FlowSubscriberEndpoint
- func (fs *FlowSubscriberEndpoint) OnConnected(c ws.Speaker) error
- func (fs *FlowSubscriberEndpoint) OnDisconnected(c ws.Speaker)
- func (fs *FlowSubscriberEndpoint) OnMessage(c ws.Speaker, m ws.Message)
- func (fs *FlowSubscriberEndpoint) SendFlows(flows []*flow.Flow)
- func (fs *FlowSubscriberEndpoint) SendStats(stats *flow.Stats)
Constants ¶
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
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
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
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