api

package
v1.6.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 6 Imported by: 59

Documentation

Index

Constants

View Source
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

View Source
var DropInvalid uint8 = 2

DropInvalid is the Invalid packet reason.

View Source
var DropMin uint8 = 130

DropMin numbers below this are non-drop reason codes

View Source
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

func DropReason(reason uint8) string

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

func PolicyDeleteRepr(deleted int, labels []string, revision uint64) (string, error)

PolicyDeleteRepr returns string representation of monitor notification

func PolicyUpdateRepr added in v1.5.0

func PolicyUpdateRepr(numRules int, labels []string, revision uint64) (string, error)

PolicyUpdateRepr returns string representation of monitor notification

func TimeRepr added in v1.5.0

func TimeRepr(t time.Time) (string, error)

TimeRepr 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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL