event

package
v0.0.0-...-1a22633 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EventDetails = map[Action]Detail{
	Delete: {
		BeforeReason:        "DeleteStarted",
		BeforeMessage:       "Delete started",
		AfterSuccessReason:  "DeleteSucceeded",
		AfterSuccessMessage: "Delete succeeded",
		AfterFailureReason:  "DeleteFailed",
	},
	Update: {
		BeforeReason:        "UpdateStarted",
		BeforeMessage:       "Update started",
		AfterSuccessReason:  "UpdateSucceeded",
		AfterSuccessMessage: "Update succeeded",
		AfterFailureReason:  "UpdateFailed",
	},
}

Functions

This section is empty.

Types

type Action

type Action string
const (
	Delete Action = "DELETE"
	Update Action = "UPDATE"
)

type Detail

type Detail struct {
	BeforeReason        string
	BeforeMessage       string
	AfterSuccessReason  string
	AfterSuccessMessage string
	AfterFailureReason  string
}

type Kind

type Kind string
const (
	Normal  Kind = "Normal"
	Warning Kind = "Warning"
)

type Recorder

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

func NewRecorder

func NewRecorder(recorder record.EventRecorder) *Recorder

func (*Recorder) Record

func (e *Recorder) Record(action Action, obj runtime.Object, do func() error) error

Wrap a function call with event records if the function call returns an error, the event will be a Warning event otherwise, the event will be a Normal event.

Jump to

Keyboard shortcuts

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