Documentation ¶
Index ¶
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) StartSink ¶
StartSink starts a new sink for the pcap sink configuration p. Any captures with a matching rule ID will be forwarded to the pcap sink p.Writer. The provided p.Header is written to the pcap sink during initialization. The sink is unregistered automatically when it stops. A sink is stopped for one of the following four reasons. In all cases, Handle.Done will be closed.
- Explicitly via Handle.Stop (Handle.Err() == nil)
- When one of the p.StopCondition is hit (Handle.Err() == nil)
- When the context ctx is cancelled (Handle.Err() != nil)
- When an error occurred (Handle.Err() != nil)
type Handle ¶
type Handle struct { // StatsUpdated is a channel on which receives a new empty message whenever // there was an update to the sink statistics. StatsUpdated <-chan struct{} // Done is a channel which is closed when this sink has been shut down. Done <-chan struct{} // contains filtered or unexported fields }
Handle enables the owner to subscribe to sink statistics
func (*Handle) Stats ¶
func (h *Handle) Stats() Statistics
Stats returns the latest statistics for this sink.
type PcapSink ¶
type PcapSink struct { RuleID uint16 Header pcap.Header Writer pcap.RecordWriter StopCondition StopConditions }
PcapSink defines the parameters of a sink which writes to a pcap.RecordWriter