types

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2023 License: Apache-2.0 Imports: 4 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EventString

func EventString(i interface{}) string

func Init

func Init(nodeName string)

Types

type CommonData

type CommonData struct {
	// Node where the event comes from
	Node string `json:"node,omitempty" column:"node,template:node" columnTags:"kubernetes"`

	// Pod namespace where the event comes from, or empty for host-level
	// event
	Namespace string `json:"namespace,omitempty" column:"namespace,template:namespace" columnTags:"kubernetes"`

	// Pod where the event comes from, or empty for host-level event
	Pod string `json:"pod,omitempty" column:"pod,template:pod" columnTags:"kubernetes"`

	// Container where the event comes from, or empty for host-level or
	// pod-level event
	Container string `json:"container,omitempty" column:"container,template:container" columnTags:"kubernetes,runtime"`
}

func (*CommonData) GetContainer added in v0.15.0

func (c *CommonData) GetContainer() string

func (*CommonData) GetNamespace added in v0.15.0

func (c *CommonData) GetNamespace() string

func (*CommonData) GetNode added in v0.15.0

func (c *CommonData) GetNode() string

func (*CommonData) GetPod added in v0.15.0

func (c *CommonData) GetPod() string

func (*CommonData) SetContainerInfo added in v0.14.0

func (c *CommonData) SetContainerInfo(pod, namespace, container string)

func (*CommonData) SetNode added in v0.14.0

func (c *CommonData) SetNode(node string)

type EndpointDetails added in v0.16.0

type EndpointDetails struct {
	Namespace string
	Name      string
	Kind      RemoteKind
	PodLabels map[string]string
}

type Event

type Event struct {
	CommonData

	// Timestamp in nanoseconds since January 1, 1970 UTC. An int64 is big
	// enough to represent time between the year 1678 and 2262.
	Timestamp Time `json:"timestamp,omitempty" column:"timestamp,template:timestamp,stringer"`

	// Type indicates the kind of this event
	Type EventType `json:"type"`

	// Message when Type is ERR, WARN, DEBUG or INFO
	Message string `json:"message,omitempty"`
}

func Debug

func Debug(msg string) Event

func Err

func Err(msg string) Event

func Info

func Info(msg string) Event

func Warn

func Warn(msg string) Event

func (Event) GetBaseEvent added in v0.11.0

func (e Event) GetBaseEvent() *Event

GetBaseEvent is needed to implement commonutils.BaseElement and snapshot.SnapshotEvent interfaces.

func (*Event) GetMessage added in v0.15.0

func (e *Event) GetMessage() string

func (*Event) GetType added in v0.15.0

func (e *Event) GetType() EventType

type EventType

type EventType string
const (
	// Indicates a generic event produced by a gadget. Gadgets extend
	// the base event to contain the specific data the gadget provides
	NORMAL EventType = "normal"

	// Event is an error message
	ERR EventType = "err"

	// Event is a warning message
	WARN EventType = "warn"

	// Event is a debug message
	DEBUG EventType = "debug"

	// Event is a info message
	INFO EventType = "info"

	// Indicates the tracer in the node is now is able to produce events
	READY EventType = "ready"
)

type RemoteKind added in v0.15.0

type RemoteKind string
const (
	RemoteKindPod     RemoteKind = "pod"
	RemoteKindService RemoteKind = "svc"
	RemoteKindOther   RemoteKind = "other"
)

type Time added in v0.13.0

type Time int64

func (Time) String added in v0.13.0

func (t Time) String() string

type WithMountNsID added in v0.14.0

type WithMountNsID struct {
	MountNsID uint64 `json:"mountnsid,omitempty" column:"mntns,template:ns"`
}

func (*WithMountNsID) GetMountNSID added in v0.14.0

func (e *WithMountNsID) GetMountNSID() uint64

type WithNetNsID added in v0.14.0

type WithNetNsID struct {
	NetNsID uint64 `json:"netnsid,omitempty" column:"netns,template:ns"`
}

func (*WithNetNsID) GetNetNSID added in v0.14.0

func (e *WithNetNsID) GetNetNSID() uint64

Jump to

Keyboard shortcuts

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