analyzer

package
v0.0.0-...-5b448de Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2017 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type FlowClient struct {
	Addr string
	Port int
	// contains filtered or unexported fields
}

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

func (*FlowClientConn) Close

func (a *FlowClientConn) Close()

Close the client

func (*FlowClientConn) Write

func (a *FlowClientConn) Write(b []byte) (int, error)

Write to the server

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) Close

func (p *FlowClientPool) Close()

Close all connections

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

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 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) Close

func (a *FlowServerConn) Close()

Close the connection

func (*FlowServerConn) Mode

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

func (*Server) Start

func (s *Server) Start()

Start the analyzer server

func (*Server) Stop

func (s *Server) Stop()

Stop the analyzer 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) ConnectAll

func (a *TopologyForwarder) ConnectAll()

ConnectAll peers

func (*TopologyForwarder) DisconnectAll

func (a *TopologyForwarder) DisconnectAll()

DisconnectAll peers

func (*TopologyForwarder) OnMessage

func (a *TopologyForwarder) OnMessage(c *shttp.WSClient, msg shttp.WSMessage)

OnMessage websocket event

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

Jump to

Keyboard shortcuts

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