flows

package
v1.3.14 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector interface {
	Run(ctx context.Context) error
}

Collector collects network flows.

type CollectorConfig

type CollectorConfig struct {
	Logger             *zap.Logger
	FlowCache          *cache.FlowCache
	Stats              *stream.Stats
	K8sClient          collector.K8sClientGetter
	CiliumNamespaces   []string
	TlsAuthProps       *tls.AuthProperties
	IPFIXCollectorPort string
	OVNKNamespace      string
}

CollectorConfig holds configuration for determining and creating flow collectors.

type CollectorFactory

type CollectorFactory interface {
	NewCollector(ctx context.Context) (Collector, error)
}

CollectorFactory creates flow collectors.

func DetectFlowCollector

func DetectFlowCollector(ctx context.Context, config CollectorConfig) (pb.FlowCollector, string, CollectorFactory)

DetectFlowCollector determines which flow collector is available and returns its type, name, and factory. Detection happens once at startup in main.go.

type FlowCollectorStreamFactory

type FlowCollectorStreamFactory struct {
	Factory       CollectorFactory
	CollectorName string // e.g., "Cilium", "OVN-K", "Falco"
}

FlowCollectorStreamFactory wraps a CollectorFactory to implement StreamClientFactory. This allows flow collectors to be managed by the stream manager like other streams.

func (*FlowCollectorStreamFactory) Name

Name returns the stream name for logging.

func (*FlowCollectorStreamFactory) NewStreamClient

NewStreamClient creates a flow collector and wraps it as a StreamClient.

type FlowSinkAdapter

type FlowSinkAdapter struct {
	FlowCache *cache.FlowCache
	Stats     *stream.Stats
}

FlowSinkAdapter adapts cache.FlowCache and Stats to implement the collector.FlowSink interface.

func NewFlowSinkAdapter

func NewFlowSinkAdapter(flowCache *cache.FlowCache, stats *stream.Stats) *FlowSinkAdapter

NewFlowSinkAdapter creates a new FlowSink adapter.

func (*FlowSinkAdapter) CacheFlow

func (f *FlowSinkAdapter) CacheFlow(ctx context.Context, flow pb.Flow) error

CacheFlow caches a flow in the flow cache.

func (*FlowSinkAdapter) IncrementFlowsReceived

func (f *FlowSinkAdapter) IncrementFlowsReceived()

IncrementFlowsReceived increments the flows received counter.

type KubernetesNetworkFlowsStream

type KubernetesNetworkFlowsStream interface {
	Send(req *pb.SendKubernetesNetworkFlowsRequest) error
	Recv() (*pb.SendKubernetesNetworkFlowsResponse, error)
}

KubernetesNetworkFlowsStream abstracts the SendKubernetesNetworkFlows gRPC stream.

type NetworkFlowsFactory

type NetworkFlowsFactory struct {
	Logger    *zap.Logger
	FlowCache *cache.FlowCache
	Stats     *stream.Stats
}

NetworkFlowsFactory creates network flows stream clients for sending flows to CloudSecure.

func (*NetworkFlowsFactory) Name

func (f *NetworkFlowsFactory) Name() string

Name returns the stream name for logging.

func (*NetworkFlowsFactory) NewStreamClient

func (f *NetworkFlowsFactory) NewStreamClient(ctx context.Context, grpcConn grpc.ClientConnInterface) (stream.StreamClient, error)

NewStreamClient creates a new network flows stream client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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