-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
consumer.go
29 lines (25 loc) · 1.16 KB
/
consumer.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
package consumer
// MonitorConsumer is a consumer of decoded monitor events
type MonitorConsumer interface {
// NotifyAgentEvent informs the consumer about a new monitor event
// sent from cilium-agent. The concrete type of the message parameter
// depends on the value of typ:
// - MessageTypeAccessLog: accesslog.LogRecord
// - MessageTypeAgent: api.AgentNotify
NotifyAgentEvent(typ int, message interface{})
// NotifyPerfEvent informs the consumer about an datapath event obtained
// via perf events ring buffer.
// Data contains the raw binary encoded perf payload. The underlying type
// depends on the value of typ:
// - MessageTypeDrop: monitor.DropNotify
// - MessageTypeDebug: monitor.DebugMsg
// - MessageTypeCapture: monitor.DebugCapture
// - MessageTypeTrace: monitor.TraceNotify
// - MessageTypePolicyVerdict: monitor.PolicyVerdictNotify
NotifyPerfEvent(data []byte, cpu int)
// NotifyPerfEventLost informs the consumer that a number of events have
// been lost due to the perf event ring buffer not being read.
NotifyPerfEventLost(numLostEvents uint64, cpu int)
}