Documentation ¶
Index ¶
- Variables
- func NewTopologyProbeBundleFromConfig(g *graph.Graph) (*probe.ProbeBundle, error)
- type FlowClient
- type FlowClientConn
- type FlowClientPool
- type FlowConnectionType
- type FlowServer
- type FlowServerConn
- func (a *FlowServerConn) Accept() (*FlowServerConn, error)
- func (a *FlowServerConn) Cleanup()
- func (a *FlowServerConn) Close()
- func (a *FlowServerConn) Mode() FlowConnectionType
- func (a *FlowServerConn) Read(data []byte) (int, error)
- func (a *FlowServerConn) SetDeadline(t time.Time)
- func (a *FlowServerConn) Timeout(err error) bool
- type Server
- type TopologyForwarder
- type TopologyForwarderPeer
- type TopologyServer
Constants ¶
This section is empty.
Variables ¶
var ErrFlowUDPAcceptNotSupported = errors.New("UDP connection is datagram based (not connected), accept() not supported")
ErrFlowUDPAcceptNotSupported error the connection can't accept as it's UDP based
Functions ¶
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
FlowClient descibes a flow client connection
func NewFlowClient ¶ added in v0.10.0
func NewFlowClient(addr string, port int) *FlowClient
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 struct {
// contains filtered or unexported fields
}
FlowClientConn describes a flow client connection
func NewFlowClientConn ¶ added in v0.10.0
func NewFlowClientConn(addr *net.UDPAddr) (a *FlowClientConn, err error)
NewFlowClientConn creates a new connection to the server at address
type FlowClientPool ¶ added in v0.10.0
type FlowClientPool struct { sync.RWMutex shttp.DefaultWSClientEventHandler // contains filtered or unexported fields }
FlowClientPool describes a flow client pool.
func NewFlowClientPool ¶ added in v0.10.0
func NewFlowClientPool(wspool *shttp.WSAsyncClientPool) *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.WSAsyncClient)
OnConnected websocket event handler
func (*FlowClientPool) OnDisconnected ¶ added in v0.10.0
func (p *FlowClientPool) OnDisconnected(c *shttp.WSAsyncClient)
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 FlowConnectionType ¶ added in v0.10.0
type FlowConnectionType int
FlowConnectionType describes an UDP or TLS connection
const ( // UDP connection UDP FlowConnectionType = 1 + iota // TLS connection TLS )
type FlowServer ¶ added in v0.10.0
type FlowServer struct { Addr string Port int Storage storage.Storage EnhancerPipeline *flow.EnhancerPipeline // contains filtered or unexported fields }
FlowServer describes a flow server with pipeline enhancers mechanism
func NewFlowServer ¶ added in v0.10.0
func NewFlowServer(addr string, port int, g *graph.Graph, store storage.Storage, probe *probe.ProbeBundle) (*FlowServer, error)
NewFlowServer creates a new flow server listening at address/port, based on configuration
type FlowServerConn ¶ added in v0.10.0
type FlowServerConn struct {
// contains filtered or unexported fields
}
FlowServerConn describes a flow server connection
func NewFlowServerConn ¶ added in v0.10.0
func NewFlowServerConn(addr *net.UDPAddr) (a *FlowServerConn, err error)
NewFlowServerConn creates a new server listening at address
func (*FlowServerConn) Accept ¶ added in v0.10.0
func (a *FlowServerConn) Accept() (*FlowServerConn, error)
Accept connection step
func (*FlowServerConn) Cleanup ¶ added in v0.10.0
func (a *FlowServerConn) Cleanup()
Cleanup stop listening on the connection
func (*FlowServerConn) Close ¶ added in v0.10.0
func (a *FlowServerConn) Close()
Close the connection
func (*FlowServerConn) Mode ¶ added in v0.10.0
func (a *FlowServerConn) Mode() FlowConnectionType
Mode returns the connection mode UDP or TLS
func (*FlowServerConn) Read ¶ added in v0.10.0
func (a *FlowServerConn) Read(data []byte) (int, error)
Read data from the connection
func (*FlowServerConn) SetDeadline ¶ added in v0.10.0
func (a *FlowServerConn) SetDeadline(t time.Time)
SetDeadline for the connection IO
func (*FlowServerConn) Timeout ¶ added in v0.10.0
func (a *FlowServerConn) Timeout(err error) bool
Timeout returns true if the connection error timeouted
type Server ¶
type Server struct { HTTPServer *shttp.Server WSServer *shttp.WSServer TopologyForwarder *TopologyForwarder TopologyServer *TopologyServer AlertServer *alert.AlertServer OnDemandClient *ondemand.OnDemandProbeClient FlowServer *FlowServer ProbeBundle *probe.ProbeBundle Storage storage.Storage EmbeddedEtcd *etcd.EmbeddedEtcd EtcdClient *etcd.EtcdClient // contains filtered or unexported fields }
Server describes an Analyzer servers mechanism like http, websocket, topology, ondemand probes, ...
func NewServerFromConfig ¶
func NewServerFromConfig() *Server
NewServerFromConfig creates a new empty server
type TopologyForwarder ¶ added in v0.10.0
type TopologyForwarder struct { shttp.DefaultWSServerEventHandler Graph *graph.Graph AuthOptions *shttp.AuthenticationOpts // contains filtered or unexported fields }
TopologyForwarder describes a topology forwarder
func NewTopologyForwarder ¶ added in v0.10.0
func NewTopologyForwarder(g *graph.Graph, server *shttp.WSServer, authOptions *shttp.AuthenticationOpts) *TopologyForwarder
NewTopologyForwarder creates a new topology forwarder based graph and webserver
func NewTopologyForwarderFromConfig ¶ added in v0.10.0
func NewTopologyForwarderFromConfig(g *graph.Graph, server *shttp.WSServer) *TopologyForwarder
NewTopologyForwarderFromConfig creates a new topology forwarder based on configration
func (*TopologyForwarder) ConnectAll ¶ added in v0.10.0
func (a *TopologyForwarder) ConnectAll()
ConnectAll peers
func (*TopologyForwarder) DisconnectAll ¶ added in v0.10.0
func (a *TopologyForwarder) DisconnectAll()
DisconnectAll peers
type TopologyForwarderPeer ¶ added in v0.10.0
type TopologyForwarderPeer struct { shttp.DefaultWSClientEventHandler Addr string Port int Graph *graph.Graph AuthOptions *shttp.AuthenticationOpts // contains filtered or unexported fields }
TopologyForwarderPeer describes a topology forwarder peer
func (*TopologyForwarderPeer) OnConnected ¶ added in v0.10.0
func (p *TopologyForwarderPeer) OnConnected(c *shttp.WSAsyncClient)
OnConnected send the whole local graph the remote peer(analyzer) once connected
type TopologyServer ¶ added in v0.10.0
type TopologyServer struct { sync.RWMutex shttp.DefaultWSServerEventHandler Graph *graph.Graph GraphServer *graph.Server // contains filtered or unexported fields }
TopologyServer describes a service to reply to topology queries
func NewTopologyServer ¶ added in v0.10.0
func NewTopologyServer(host string, server *shttp.WSServer) (*TopologyServer, error)
NewTopologyServer creates a new topology server
func NewTopologyServerFromConfig ¶ added in v0.10.0
func NewTopologyServerFromConfig(server *shttp.WSServer) (*TopologyServer, error)
NewTopologyServerFromConfig creates a new topology server based on configuration
func (*TopologyServer) OnGraphMessage ¶ added in v0.11.0
func (t *TopologyServer) OnGraphMessage(c *shttp.WSClient, msg shttp.WSMessage, msgType string, obj interface{})
OnGraphMessage websocket event
func (*TopologyServer) OnUnregisterClient ¶ added in v0.10.0
func (t *TopologyServer) OnUnregisterClient(c *shttp.WSClient)
OnUnregisterClient websocket event