producer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2025 License: MIT Imports: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrAttr added in v1.0.1

func ErrAttr(err error) slog.Attr

func NewLogger added in v1.0.1

func NewLogger(id string) *slog.Logger

NewLogger creates a logger instance

Types

type Event

type Event struct {
	Timestamp time.Time   `json:"timestamp,omitempty"`
	Transport string      `json:"transport,omitempty"`
	SrcHost   string      `json:"srcHost,omitempty"`
	SrcPort   string      `json:"srcPort,omitempty"`
	DstPort   uint16      `json:"dstPort,omitempty"`
	SensorID  string      `json:"sensorID,omitempty"`
	Rule      string      `json:"rule,omitempty"`
	Handler   string      `json:"handler,omitempty"`
	Payload   string      `json:"payload,omitempty"`
	Scanner   string      `json:"scanner,omitempty"`
	Decoded   interface{} `json:"decoded,omitempty"`
}

Event is a struct for glutton events

type Producer

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

Producer for the producer

func New

func New(sensorID string) (*Producer, error)

New initializes the producers

func (*Producer) LogTCP

func (p *Producer) LogTCP(handler string, conn net.Conn, md connection.Metadata, payload []byte, decoded interface{}) error

LogTCP is a meta caller for all producers

func (*Producer) LogUDP

func (p *Producer) LogUDP(handler string, srcAddr *net.UDPAddr, md connection.Metadata, payload []byte, decoded interface{}) error

LogUDP is a meta caller for all producers

type TeeWriter added in v1.0.1

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

func (*TeeWriter) Write added in v1.0.1

func (t *TeeWriter) Write(p []byte) (n int, err error)

Jump to

Keyboard shortcuts

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