1
0
mirror of https://github.com/netsampler/goflow2.git synced 2024-05-06 15:54:52 +00:00

25 lines
521 B
Go
Raw Normal View History

2023-08-09 19:47:20 -07:00
package producer
import (
"net/netip"
"time"
)
// Interface of the messages
type ProducerMessage interface{}
type ProducerInterface interface {
// Converts a message into a list of flow samples
Produce(msg interface{}, args *ProduceArgs) ([]ProducerMessage, error)
// Indicates to the producer the messages returned were processed
Commit([]ProducerMessage)
Close()
}
type ProduceArgs struct {
Src netip.AddrPort
Dst netip.AddrPort
SamplerAddress netip.Addr
TimeReceived time.Time
}