Documentation ¶
Overview ¶
Package pktgrpc provides the basic interfaces to build a gRPC+Protobuf packet client & server
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientConnection ¶
type ClientConnection struct {
// contains filtered or unexported fields
}
ClientConnection wraps a gRPC+protobuf connection
func ConnectClient ¶
func ConnectClient(hostIP string, hostPort int) (*ClientConnection, error)
func (*ClientConnection) Client ¶
func (cp *ClientConnection) Client() pbpacket.CollectorClient
func (*ClientConnection) Close ¶
func (cp *ClientConnection) Close() error
type CollectorOption ¶
type CollectorOption func(options *collectorOptions)
CollectorOption allows overriding the default configuration of the CollectorServer instance. Use them in the StartCollector function.
func WithGRPCServerOptions ¶
func WithGRPCServerOptions(options ...grpc.ServerOption) CollectorOption
type CollectorServer ¶
type CollectorServer struct {
// contains filtered or unexported fields
}
CollectorServer wraps a Flow Collector connection & session
func StartCollector ¶
func StartCollector( port int, pktForwarder chan<- *pbpacket.Packet, options ...CollectorOption, ) (*CollectorServer, error)
StartCollector listens in background for gRPC+Protobuf flows in the given port, and forwards each set of *pbpacket.Packet by the provided channel.
func (*CollectorServer) Close ¶
func (c *CollectorServer) Close() error
Click to show internal directories.
Click to hide internal directories.