api

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

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 (
	// 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 EndpointRegenRepr

func EndpointRegenRepr(e notifications.RegenNotificationInfo, err error) (string, error)

EndpointRegenRepr returns string representation of monitor notification

func PolicyDeleteRepr

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

PolicyDeleteRepr returns string representation of monitor notification

func PolicyUpdateRepr

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

PolicyUpdateRepr returns string representation of monitor notification

func TimeRepr

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
)

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