Documentation ¶
Index ¶
- Constants
- Variables
- func DropReason(reason uint8) string
- func EndpointCreateRepr(e notifications.RegenNotificationInfo) (string, error)
- func EndpointDeleteRepr(e notifications.RegenNotificationInfo) (string, error)
- func EndpointRegenRepr(e notifications.RegenNotificationInfo, err error) (string, error)
- func PolicyDeleteRepr(deleted int, labels []string, revision uint64) (string, error)
- func PolicyUpdateRepr(numRules int, labels []string, revision uint64) (string, error)
- func TimeRepr(t time.Time) (string, error)
- type AgentNotification
- type AgentNotify
- type EndpointCreateNotification
- type EndpointDeleteNotification
- type EndpointRegenNotification
- type MessageTypeFilter
- type PolicyUpdateNotification
- type TimeNotification
Constants ¶
const ( // 0-128 are reserved for BPF datapath events MessageTypeUnspec = iota MessageTypeDrop MessageTypeDebug MessageTypeCapture MessageTypeTrace // MessageTypeAccessLog contains a pkg/proxy/accesslog.LogRecord MessageTypeAccessLog = 129 // MessageTypeAgent is an agent notification carrying a AgentNotify MessageTypeAgent = 130 )
Must be synchronized with <bpf/lib/common.h>
Variables ¶
var DropInvalid uint8 = 2
DropInvalid is the Invalid packet reason.
var DropMin uint8 = 130
DropMin numbers below this are non-drop reason codes
var ( // MessageTypeNames is a map of all type names MessageTypeNames = map[string]int{ "drop": MessageTypeDrop, "debug": MessageTypeDebug, "capture": MessageTypeCapture, "trace": MessageTypeTrace, "l7": MessageTypeAccessLog, "agent": MessageTypeAgent, } )
Functions ¶
func DropReason ¶
DropReason prints the drop reason in a human readable string
func EndpointCreateRepr ¶ added in v1.6.0
func EndpointCreateRepr(e notifications.RegenNotificationInfo) (string, error)
EndpointCreateRepr returns string representation of monitor notification
func EndpointDeleteRepr ¶ added in v1.6.0
func EndpointDeleteRepr(e notifications.RegenNotificationInfo) (string, error)
EndpointDeleteRepr returns string representation of monitor notification
func EndpointRegenRepr ¶ added in v1.5.0
func EndpointRegenRepr(e notifications.RegenNotificationInfo, err error) (string, error)
EndpointRegenRepr returns string representation of monitor notification
func PolicyDeleteRepr ¶ added in v1.5.0
PolicyDeleteRepr returns string representation of monitor notification
func PolicyUpdateRepr ¶ added in v1.5.0
PolicyUpdateRepr returns string representation of monitor notification
Types ¶
type AgentNotification ¶
type AgentNotification uint32
AgentNotification specifies the type of agent notification
const ( AgentNotifyUnspec AgentNotification = iota AgentNotifyGeneric AgentNotifyStart AgentNotifyEndpointRegenerateSuccess AgentNotifyEndpointRegenerateFail AgentNotifyPolicyUpdated AgentNotifyPolicyDeleted AgentNotifyEndpointCreated AgentNotifyEndpointDeleted )
type AgentNotify ¶
type AgentNotify struct { Type AgentNotification Text string }
AgentNotify is a notification from the agent
func (*AgentNotify) DumpInfo ¶
func (n *AgentNotify) DumpInfo()
DumpInfo dumps an agent notification
func (*AgentNotify) DumpJSON ¶
func (n *AgentNotify) DumpJSON()
DumpJSON prints notification in json format
type EndpointCreateNotification ¶ added in v1.6.0
type EndpointCreateNotification struct { EndpointRegenNotification PodName string `json:"pod-name,omitempty"` Namespace string `json:"namespace,omitempty"` }
EndpointCreateNotification structures the endpoint create notification
type EndpointDeleteNotification ¶ added in v1.6.0
type EndpointDeleteNotification struct { EndpointRegenNotification PodName string `json:"pod-name,omitempty"` Namespace string `json:"namespace,omitempty"` }
EndpointDeleteNotification structures the an endpoint delete notification
type EndpointRegenNotification ¶
type EndpointRegenNotification struct { ID uint64 `json:"id,omitempty"` Labels []string `json:"labels,omitempty"` Error string `json:"error,omitempty"` }
EndpointRegenNotification structures regeneration notification
type MessageTypeFilter ¶
type MessageTypeFilter []int
func (*MessageTypeFilter) Contains ¶
func (m *MessageTypeFilter) Contains(typ int) bool
func (*MessageTypeFilter) Set ¶
func (m *MessageTypeFilter) Set(value string) error
func (*MessageTypeFilter) String ¶
func (m *MessageTypeFilter) String() string
func (*MessageTypeFilter) Type ¶
func (m *MessageTypeFilter) Type() string
type PolicyUpdateNotification ¶
type PolicyUpdateNotification struct { Labels []string `json:"labels,omitempty"` Revision uint64 `json:"revision,omitempty"` RuleCount int `json:"rule_count"` }
PolicyUpdateNotification structures update notification
type TimeNotification ¶
type TimeNotification struct {
Time string `json:"time"`
}
TimeNotification structures agent start notification