record

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromContext added in v1.9.0

func FromContext(ctx context.Context) contextValueType

FromContext returns the recorder from the specified context.

func WithContext added in v1.9.0

func WithContext(parent context.Context, val contextValueType) context.Context

WithContext returns a new recorder context.

Types

type Recorder

type Recorder interface {
	// EmitEvent records a Success or Failure depending on whether or not an error occurred.
	EmitEvent(object runtime.Object, opName string, err error, ignoreSuccess bool)

	// Event constructs an event from the given information and puts it in the queue for sending.
	Event(object runtime.Object, reason, message string)

	// Eventf is just like Event, but with Sprintf for the message field.
	Eventf(object runtime.Object, reason, message string, args ...interface{})

	// Warn constructs a warning event from the given information and puts it in the queue for sending.
	Warn(object runtime.Object, reason, message string)

	// Warnf is just like Event, but with Sprintf for the message field.
	Warnf(object runtime.Object, reason, message string, args ...interface{})
}

Recorder knows how to record events on behalf of a source.

func New

func New(eventRecorder record.EventRecorder) Recorder

New returns a new instance of a Recorder.

Jump to

Keyboard shortcuts

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