Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SelectDecoders ¶
func SelectDecoders[T any](defaults []T, include, exclude string, nameOf func(T) string, invalidDecoder error) ([]T, error)
SelectDecoders selects a private slice of defaults using globally registered names.
func SetErrorMap ¶
func SetErrorMap(e *AtomicCounterMap)
SetErrorMap sets the map for tracking errors it gets passed in from the collector during initialization
Types ¶
type AtomicCounterMap ¶
type AtomicCounterMap struct {
sync.Mutex
Items map[string]int64
// contains filtered or unexported fields
}
AtomicCounterMap maps strings to integers.
var ( // AllDecoderNames contains the decoder names at runtime. AllDecoderNames = make(map[string]struct{}) // ErrorMap contains error during reassembly at runtime. ErrorMap *AtomicCounterMap )
func NewAtomicCounterMap ¶
func NewAtomicCounterMap() *AtomicCounterMap
NewAtomicCounterMap returns a new AtomicCounterMap.
func (*AtomicCounterMap) NewShard ¶
func (a *AtomicCounterMap) NewShard() *AtomicCounterMap
NewShard registers a worker-local counter on the root. Call only on the root.
func (*AtomicCounterMap) Snapshot ¶
func (a *AtomicCounterMap) Snapshot() map[string]int64
Snapshot copies root and shard counts. Each map is read under its own lock; the result is not a global cross-shard transaction.
type PacketInfo ¶
type PacketInfo struct {
Packet gopacket.Packet
Timestamp int64
SrcMAC string
DstMAC string
SrcIP string
DstIP string
}
PacketInfo contains packet meta information.
func NewPacketInfo ¶
func NewPacketInfo(p gopacket.Packet) *PacketInfo
NewPacketInfo returns a new packet summary