Documentation
¶
Index ¶
- func NewAnalyzerAuthenticationOpts() *shttp.AuthenticationOpts
- func NewTopologyProbeBundleFromConfig(g *graph.Graph) (*probe.ProbeBundle, error)
- type AnalyzerStatus
- type ElectionStatus
- type FlowClient
- type FlowClientConn
- type FlowClientPool
- type FlowClientUDPConn
- type FlowClientWebSocketConn
- type FlowServer
- type FlowServerConn
- type FlowServerUDPConn
- type FlowServerWebSocketConn
- type Server
- type TopologyReplicatorPeer
- type TopologyServer
- func (t *TopologyServer) ConnectPeers()
- func (t *TopologyServer) DisconnectPeers()
- func (t *TopologyServer) OnDisconnected(c shttp.WSSpeaker)
- func (t *TopologyServer) OnEdgeAdded(e *graph.Edge)
- func (t *TopologyServer) OnEdgeDeleted(e *graph.Edge)
- func (t *TopologyServer) OnEdgeUpdated(e *graph.Edge)
- func (t *TopologyServer) OnNodeAdded(n *graph.Node)
- func (t *TopologyServer) OnNodeDeleted(n *graph.Node)
- func (t *TopologyServer) OnNodeUpdated(n *graph.Node)
- func (t *TopologyServer) OnWSJSONMessage(c shttp.WSSpeaker, msg *shttp.WSJSONMessage)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAnalyzerAuthenticationOpts ¶ added in v0.13.0
func NewAnalyzerAuthenticationOpts() *shttp.AuthenticationOpts
NewAnalyzerAuthenticationOpts returns an object to authenticate to the analyzer
Types ¶
type AnalyzerStatus ¶ added in v0.13.0
type AnalyzerStatus struct {
Clients map[string]shttp.WSConnStatus
Peers map[string]shttp.WSConnStatus
Alerts ElectionStatus
Captures ElectionStatus
}
AnalyzerStatus describes the status of an analyzer
type ElectionStatus ¶ added in v0.13.0
type ElectionStatus struct {
IsMaster bool
}
ElectionStatus describes the status of an election
type FlowClient ¶ added in v0.12.0
type FlowClient struct {
// contains filtered or unexported fields
}
FlowClient describes a flow client connection
func NewFlowClient ¶ added in v0.12.0
func NewFlowClient(addr string, port int) (*FlowClient, error)
NewFlowClient creates a flow client and creates a new connection to the server
func (*FlowClient) SendFlow ¶ added in v0.12.0
func (c *FlowClient) SendFlow(f *flow.Flow) error
SendFlow sends a flow to the server
func (*FlowClient) SendFlows ¶ added in v0.12.0
func (c *FlowClient) SendFlows(flows []*flow.Flow)
SendFlows sends flows to the server
type FlowClientConn ¶ added in v0.12.0
FlowClientConn is the interface to be implemented by the flow clients
type FlowClientPool ¶ added in v0.12.0
type FlowClientPool struct {
sync.RWMutex
shttp.DefaultWSSpeakerEventHandler
// contains filtered or unexported fields
}
FlowClientPool describes a flow client pool.
func NewFlowClientPool ¶ added in v0.12.0
func NewFlowClientPool(pool shttp.WSSpeakerPool) *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.12.0
func (p *FlowClientPool) Close()
Close all connections
func (*FlowClientPool) OnConnected ¶ added in v0.12.0
func (p *FlowClientPool) OnConnected(c shttp.WSSpeaker)
OnConnected websocket event handler
func (*FlowClientPool) OnDisconnected ¶ added in v0.12.0
func (p *FlowClientPool) OnDisconnected(c shttp.WSSpeaker)
OnDisconnected websocket event handler
func (*FlowClientPool) SendFlows ¶ added in v0.12.0
func (p *FlowClientPool) SendFlows(flows []*flow.Flow)
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 {
shttp.DefaultWSSpeakerEventHandler
// contains filtered or unexported fields
}
FlowClientWebSocketConn describes WebSocket client connection
func NewFlowClientWebSocketConn ¶ added in v0.13.0
func NewFlowClientWebSocketConn(addr string, port int) (*FlowClientWebSocketConn, error)
NewFlowClientUDPConn 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() 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.12.0
type FlowServer struct {
Storage storage.Storage
EnhancerPipeline *flow.EnhancerPipeline
Server *shttp.Server
// contains filtered or unexported fields
}
FlowServer describes a flow server with pipeline enhancers mechanism
type FlowServerConn ¶ added in v0.12.0
FlowServerConn describes a flow server connection
type FlowServerUDPConn ¶ added in v0.13.0
type FlowServerUDPConn struct {
// contains filtered or unexported fields
}
FlowServerConn 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
type FlowServerWebSocketConn ¶ added in v0.13.0
type FlowServerWebSocketConn struct {
shttp.DefaultWSSpeakerEventHandler
// contains filtered or unexported fields
}
FlowServerConn describes a WebSocket flow server connection
func NewFlowServerWebSocketConn ¶ added in v0.13.0
func NewFlowServerWebSocketConn(server *shttp.Server) (*FlowServerWebSocketConn, error)
NewFlowServerWebSocketConn returns a new WebSocket flow server
type Server ¶
type Server struct {
HTTPServer *shttp.Server
WSServer *shttp.WSJSONServer
TopologyServer *TopologyServer
AlertServer *alert.AlertServer
OnDemandClient *ondemand.OnDemandProbeClient
MetadataManager *metadata.UserMetadataManager
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 TopologyReplicatorPeer ¶ added in v0.13.0
type TopologyReplicatorPeer struct {
shttp.DefaultWSSpeakerEventHandler
Addr string
Port int
Graph *graph.Graph
AuthOptions *shttp.AuthenticationOpts
// contains filtered or unexported fields
}
TopologyReplicatorPeer is a remote connection to another Graph server. Only modification of the local Graph made either by the local server, by an agent message or by an external client will be forwarded to the peer.
func (*TopologyReplicatorPeer) OnConnected ¶ added in v0.13.0
func (p *TopologyReplicatorPeer) OnConnected(c shttp.WSSpeaker)
OnConnected is called when the peer gets connected then the whole graph is send to initialize it.
type TopologyServer ¶ added in v0.12.0
type TopologyServer struct {
sync.RWMutex
shttp.DefaultWSSpeakerEventHandler
Graph *graph.Graph
// contains filtered or unexported fields
}
TopologyServer serves the local Graph and send local modification to its peers. Only modification of the local Graph made either by the local server, by an agent message or by an external client will be forwarded to the peers.
func NewTopologyServer ¶ added in v0.12.0
func NewTopologyServer(pool shttp.WSJSONSpeakerPool, auth *shttp.AuthenticationOpts) (*TopologyServer, error)
NewTopologyServer returns a new server which servers the local Graph and replicates messages coming from agents or external clients.
func (*TopologyServer) ConnectPeers ¶ added in v0.13.0
func (t *TopologyServer) ConnectPeers()
ConnectPeers starts a goroutine connecting all the peers.
func (*TopologyServer) DisconnectPeers ¶ added in v0.13.0
func (t *TopologyServer) DisconnectPeers()
DisconnectPeers disconnects all the peers and wait until all disconnected.
func (*TopologyServer) OnDisconnected ¶ added in v0.13.0
func (t *TopologyServer) OnDisconnected(c shttp.WSSpeaker)
OnDisconnected called when a WSSpeaker got disconnected. The WSSPeaker can be either a peer, an agent or an external client.
func (*TopologyServer) OnEdgeAdded ¶ added in v0.13.0
func (t *TopologyServer) OnEdgeAdded(e *graph.Edge)
OnEdgeAdded graph edge added event. Implements the GraphEventListener interface.
func (*TopologyServer) OnEdgeDeleted ¶ added in v0.13.0
func (t *TopologyServer) OnEdgeDeleted(e *graph.Edge)
OnEdgeDeleted graph edge deleted event. Implements the GraphEventListener interface.
func (*TopologyServer) OnEdgeUpdated ¶ added in v0.13.0
func (t *TopologyServer) OnEdgeUpdated(e *graph.Edge)
OnEdgeUpdated graph edge updated event. Implements the GraphEventListener interface.
func (*TopologyServer) OnNodeAdded ¶ added in v0.13.0
func (t *TopologyServer) OnNodeAdded(n *graph.Node)
OnNodeAdded graph node added event. Implements the GraphEventListener interface.
func (*TopologyServer) OnNodeDeleted ¶ added in v0.13.0
func (t *TopologyServer) OnNodeDeleted(n *graph.Node)
OnNodeDeleted graph node deleted event. Implements the GraphEventListener interface.
func (*TopologyServer) OnNodeUpdated ¶ added in v0.13.0
func (t *TopologyServer) OnNodeUpdated(n *graph.Node)
OnNodeUpdated graph node updated event. Implements the GraphEventListener interface.
func (*TopologyServer) OnWSJSONMessage ¶ added in v0.13.0
func (t *TopologyServer) OnWSJSONMessage(c shttp.WSSpeaker, msg *shttp.WSJSONMessage)
OnWSJSONMessage is triggered by message coming from websocket Speaker. It can be any kind of client, peer, agent, external client.
Source Files
¶
- flow_client.go
- flow_server.go
- probes.go
- server.go
- topology_server.go