Documentation ¶
Index ¶
- type Dispatch
- func (d *Dispatch) NotifyAgentEvent(typ int, message interface{})
- func (d *Dispatch) NotifyPerfEvent(data []byte, cpu int)
- func (d *Dispatch) NotifyPerfEventLost(numLostEvents uint64, cpu int)
- func (d *Dispatch) RegisterSink(ctx context.Context, ruleID uint16, w pcap.RecordWriter, header pcap.Header) (*Handle, error)
- func (d *Dispatch) UnregisterSink(ctx context.Context, ruleID uint16) (stats Statistics, err error)
- type Handle
- type Statistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Dispatch ¶
type Dispatch struct {
// contains filtered or unexported fields
}
Dispatch implements consumer.MonitorConsumer and dispatches incoming recorder captures to registered sinks based on their rule ID.
func NewDispatch ¶
NewDispatch creates a new sink dispatcher. Each registered sink may have a queue of up to sinkQueueSize pending captures.
func (*Dispatch) NotifyAgentEvent ¶
NotifyAgentEvent implements consumer.MonitorConsumer
func (*Dispatch) NotifyPerfEvent ¶
NotifyPerfEvent implements consumer.MonitorConsumer
func (*Dispatch) NotifyPerfEventLost ¶
NotifyPerfEventLost implements consumer.MonitorConsumer
func (*Dispatch) RegisterSink ¶ added in v1.10.0
func (d *Dispatch) RegisterSink(ctx context.Context, ruleID uint16, w pcap.RecordWriter, header pcap.Header) (*Handle, error)
RegisterSink registers a new sink for the given rule ID. Any captures with a matching rule ID will be forwarded to the pcap sink w. The provided header is written to the pcap sink w upon initialization.
func (*Dispatch) UnregisterSink ¶ added in v1.10.0
UnregisterSink will stop and unregister the sink for the given ruleID. It waits for any pending packets to be forwarded to the sink before closing it and returns the final statistics or an error, if an error occurred.
type Handle ¶
type Handle struct { // C is a channel on which receives a new empty message whenever there // was an update to the sink statistics. It is closed when the sink stops // updating. C <-chan struct{} // contains filtered or unexported fields }
Handle enables the owner to subscribe to sink statistics
func (*Handle) Stats ¶
func (h *Handle) Stats() Statistics