utils

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2024 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AutoFlowPipe added in v2.1.0

type AutoFlowPipe struct {
	*SFlowPipe
	*NetFlowPipe
}

func NewFlowPipe added in v2.1.0

func NewFlowPipe(cfg *PipeConfig) *AutoFlowPipe

func (*AutoFlowPipe) Close added in v2.1.0

func (p *AutoFlowPipe) Close()

func (*AutoFlowPipe) DecodeFlow added in v2.1.0

func (p *AutoFlowPipe) DecodeFlow(msg interface{}) error

type BatchMute added in v2.1.2

type BatchMute struct {
	// contains filtered or unexported fields
}

func NewBatchMute added in v2.1.2

func NewBatchMute(resetInterval time.Duration, max int) *BatchMute

func (*BatchMute) Increment added in v2.1.2

func (b *BatchMute) Increment() (muting bool, skipped int)

type DecoderFunc

type DecoderFunc func(msg interface{}) error

Callback used to decode a UDP message

type FlowPipe

type FlowPipe interface {
	DecodeFlow(msg interface{}) error
	Close()
}

type Message

type Message struct {
	Src      netip.AddrPort
	Dst      netip.AddrPort
	Payload  []byte
	Received time.Time
}

type NetFlowPipe

type NetFlowPipe struct {
	// contains filtered or unexported fields
}

func NewNetFlowPipe

func NewNetFlowPipe(cfg *PipeConfig) *NetFlowPipe

func (*NetFlowPipe) Close

func (p *NetFlowPipe) Close()

func (*NetFlowPipe) DecodeFlow

func (p *NetFlowPipe) DecodeFlow(msg interface{}) error

type PipeConfig

type PipeConfig struct {
	Format    format.FormatInterface
	Transport transport.TransportInterface
	Producer  producer.ProducerInterface

	NetFlowTemplater templates.TemplateSystemGenerator
}

type PipeMessageError

type PipeMessageError struct {
	Message *Message
	Err     error
}

func (*PipeMessageError) Error

func (e *PipeMessageError) Error() string

func (*PipeMessageError) Unwrap

func (e *PipeMessageError) Unwrap() error

type ReceiverCallback added in v2.1.1

type ReceiverCallback interface {
	Dropped(msg Message)
}

type ReceiverError

type ReceiverError struct {
	Err error
}

func (*ReceiverError) Error

func (e *ReceiverError) Error() string

func (*ReceiverError) Unwrap

func (e *ReceiverError) Unwrap() error

type SFlowPipe

type SFlowPipe struct {
	// contains filtered or unexported fields
}

func NewSFlowPipe

func NewSFlowPipe(cfg *PipeConfig) *SFlowPipe

func (*SFlowPipe) Close

func (p *SFlowPipe) Close()

func (*SFlowPipe) DecodeFlow

func (p *SFlowPipe) DecodeFlow(msg interface{}) error

type UDPReceiver

type UDPReceiver struct {
	// contains filtered or unexported fields
}

func NewUDPReceiver

func NewUDPReceiver(cfg *UDPReceiverConfig) (*UDPReceiver, error)

func (*UDPReceiver) Errors

func (r *UDPReceiver) Errors() <-chan error

func (*UDPReceiver) Start

func (r *UDPReceiver) Start(addr string, port int, decodeFunc DecoderFunc) error

Start UDP receivers and the processing routines

func (*UDPReceiver) Stop

func (r *UDPReceiver) Stop() error

Stops the routines

type UDPReceiverConfig

type UDPReceiverConfig struct {
	Workers   int
	Sockets   int
	Blocking  bool
	QueueSize int

	ReceiverCallback ReceiverCallback
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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