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 ¶
func NewTopologyProbeBundleFromConfig(g *graph.Graph) (*probe.ProbeBundle, error)
NewTopologyProbeBundleFromConfig creates a new topology server probes from configuration
Types ¶
type FlowClient ¶
FlowClient descibes a flow client connection
func NewFlowClient ¶
func NewFlowClient(addr string, port int) *FlowClient
NewFlowClient creates a flow client and creates a new connection to the server
func (*FlowClient) SendFlow ¶
func (c *FlowClient) SendFlow(f *flow.Flow) error
SendFlow sends a flow to the server
func (*FlowClient) SendFlows ¶
func (c *FlowClient) SendFlows(flows []*flow.Flow)
SendFlows sends flows to the server
type FlowClientConn ¶
type FlowClientConn struct {
// contains filtered or unexported fields
}
FlowClientConn describes a flow client connection
func NewFlowClientConn ¶
func NewFlowClientConn(addr *net.UDPAddr) (a *FlowClientConn, err error)
NewFlowClientConn creates a new connection to the server at address
type FlowClientPool ¶
type FlowClientPool struct { sync.RWMutex shttp.DefaultWSClientEventHandler // contains filtered or unexported fields }
FlowClientPool describes a flow client pool.
func NewFlowClientPool ¶
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) OnConnected ¶
func (p *FlowClientPool) OnConnected(c *shttp.WSAsyncClient)
OnConnected websocket event handler
func (*FlowClientPool) OnDisconnected ¶
func (p *FlowClientPool) OnDisconnected(c *shttp.WSAsyncClient)
OnDisconnected websocket event handler
func (*FlowClientPool) SendFlows ¶
func (p *FlowClientPool) SendFlows(flows []*flow.Flow)
SendFlows sends flows using a random connection
type FlowConnectionType ¶
type FlowConnectionType int
FlowConnectionType describes an UDP or TLS connection
const ( // UDP connection UDP FlowConnectionType = 1 + iota // TLS connection TLS )
type FlowServer ¶
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 ¶
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 ¶
type FlowServerConn struct {
// contains filtered or unexported fields
}
FlowServerConn describes a flow server connection
func NewFlowServerConn ¶
func NewFlowServerConn(addr *net.UDPAddr) (a *FlowServerConn, err error)
NewFlowServerConn creates a new server listening at address
func (*FlowServerConn) Accept ¶
func (a *FlowServerConn) Accept() (*FlowServerConn, error)
Accept connection step
func (*FlowServerConn) Cleanup ¶
func (a *FlowServerConn) Cleanup()
Cleanup stop listening on the connection
func (*FlowServerConn) Mode ¶
func (a *FlowServerConn) Mode() FlowConnectionType
Mode returns the connection mode UDP or TLS
func (*FlowServerConn) Read ¶
func (a *FlowServerConn) Read(data []byte) (int, error)
Read data from the connection
func (*FlowServerConn) SetDeadline ¶
func (a *FlowServerConn) SetDeadline(t time.Time)
SetDeadline for the connection IO
func (*FlowServerConn) Timeout ¶
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 ¶
type TopologyForwarder struct { shttp.DefaultWSServerEventHandler Graph *graph.Graph AuthOptions *shttp.AuthenticationOpts // contains filtered or unexported fields }
TopologyForwarder describes a topology forwarder
func NewTopologyForwarder ¶
func NewTopologyForwarder(g *graph.Graph, server *shttp.WSServer, authOptions *shttp.AuthenticationOpts) *TopologyForwarder
NewTopologyForwarder creates a new topology forwarder based graph and webserver
func NewTopologyForwarderFromConfig ¶
func NewTopologyForwarderFromConfig(g *graph.Graph, server *shttp.WSServer) *TopologyForwarder
NewTopologyForwarderFromConfig creates a new topology forwarder based on configration
func (*TopologyForwarder) DisconnectAll ¶
func (a *TopologyForwarder) DisconnectAll()
DisconnectAll peers
type TopologyForwarderPeer ¶
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 ¶
func (p *TopologyForwarderPeer) OnConnected(c *shttp.WSAsyncClient)
OnConnected send the whole local graph the remote peer(analyzer) once connected
type TopologyServer ¶
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 ¶
func NewTopologyServer(host string, server *shttp.WSServer) (*TopologyServer, error)
NewTopologyServer creates a new topology server
func NewTopologyServerFromConfig ¶
func NewTopologyServerFromConfig(server *shttp.WSServer) (*TopologyServer, error)
NewTopologyServerFromConfig creates a new topology server based on configuration
func (*TopologyServer) OnGraphMessage ¶
func (t *TopologyServer) OnGraphMessage(c *shttp.WSClient, msg shttp.WSMessage, msgType string, obj interface{})
OnGraphMessage websocket event
func (*TopologyServer) OnUnregisterClient ¶
func (t *TopologyServer) OnUnregisterClient(c *shttp.WSClient)
OnUnregisterClient websocket event