mirror of
https://github.com/netsampler/goflow2.git
synced 2024-05-06 15:54:52 +00:00
25 lines
521 B
Go
25 lines
521 B
Go
![]() |
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
|
||
|
}
|