Help us shape the future of Go! Take the 2026 Go Developer Survey

event

package
v2.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 128

Documentation

Overview

Package event records Kubernetes events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIRecorder

type APIRecorder struct {
	// contains filtered or unexported fields
}

An APIRecorder records Kubernetes events to an API server.

func NewAPIRecorder

func NewAPIRecorder(r record.EventRecorder, fns ...FilterFn) *APIRecorder

NewAPIRecorder returns an APIRecorder that records Kubernetes events to an APIServer using the supplied EventRecorder.

func (*APIRecorder) Event

func (r *APIRecorder) Event(obj runtime.Object, e Event)

Event records the supplied event.

func (*APIRecorder) WithAnnotations

func (r *APIRecorder) WithAnnotations(keysAndValues ...string) Recorder

WithAnnotations returns a new *APIRecorder that includes the supplied annotations with all recorded events.

type Event

type Event struct {
	Type        Type
	Reason      Reason
	Message     string
	Annotations map[string]string
}

An Event relating to a Crossplane resource.

func Normal

func Normal(r Reason, message string, keysAndValues ...string) Event

Normal returns a normal, informational event.

func Warning

func Warning(r Reason, err error, keysAndValues ...string) Event

Warning returns a warning event, typically due to an error.

type FilterFn

type FilterFn func(obj runtime.Object, e Event) bool

FilterFn is a function used to filter events. It should return false when events should not be sent.

type NopRecorder

type NopRecorder struct{}

A NopRecorder does nothing.

func NewNopRecorder

func NewNopRecorder() *NopRecorder

NewNopRecorder returns a Recorder that does nothing.

func (*NopRecorder) Event

func (r *NopRecorder) Event(_ runtime.Object, _ Event)

Event does nothing.

func (*NopRecorder) WithAnnotations

func (r *NopRecorder) WithAnnotations(_ ...string) Recorder

WithAnnotations does nothing.

type Reason

type Reason string

Reason an event occurred.

type Recorder

type Recorder interface {
	Event(obj runtime.Object, e Event)
	WithAnnotations(keysAndValues ...string) Recorder
}

A Recorder records Kubernetes events.

type Type

type Type string

A Type of event.

const (
	TypeNormal  Type = "Normal"
	TypeWarning Type = "Warning"
)

Event types. See below for valid types. https://godoc.org/k8s.io/client-go/tools/record#EventRecorder

Jump to

Keyboard shortcuts

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