pktgrpc

package
v1.6.0-crc0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

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 (*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

Jump to

Keyboard shortcuts

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