eventer

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// Add events
	ReasonAdding        = "Adding"
	ReasonFailedToAdd   = "FailedToAdd"
	ReasonSuccessfulAdd = "SuccessfulAdd"

	// Delete events
	ReasonDeleting         = "Deleting"
	ReasonFailedToDelete   = "FailedToDelete"
	ReasonSuccessfulDelete = "SuccessfulDelete"

	// Create events
	ReasonCreating         = "Creating"
	ReasonFailedCreate     = "FailedToCreate"
	ReasonSuccessfulCreate = "SuccessfulCreate"

	// Update events
	ReasonUpdating         = "Updating"
	ReasonFailedToUpdate   = "FailedToUpdate"
	ReasonSuccessfulUpdate = "SuccessfulUpdate"

	// Sync events
	ReasonSyncing     = "Syncing"
	ReasonFailSync    = "FailedToSync"
	ReasonSuccessSync = "SuccessfulSync"

	// Misc events
	ReasonLongerThanUsual = "TimeLongerThanUsual"
	ReasonUnknown         = "Unknown"
)

Types of kubernetes emitted events

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option provides configuration of an eventer.

func WithClient

func WithClient(c kubernetes.Interface) Option

WithClient sets a client for the eventer (required).

func WithComponent

func WithComponent(c string) Option

WithComponent sets a component for the eventer.

func WithLogger

func WithLogger(l *zap.Logger) Option

WithLogger sets a logger for the eventer. If not set a noop logger will be used.

func WithNamespace

func WithNamespace(ns string) Option

WithNamespace sets a namespace for the eventer.

type Poster

type Poster interface {
	NormalEvent(object runtime.Object, reason, message string, args ...interface{})
	WarningEvent(object runtime.Object, reason, message string, args ...interface{})
}

Poster posts events accordingly to kind of behavior

func NewEventRecorder

func NewEventRecorder(eventerOpts ...Option) (Poster, error)

NewEventRecorder creates a new recorder to emit kubernetes events.

func NewNopPoster

func NewNopPoster() Poster

NewNopPoster returns an Poster that does nothing.

Jump to

Keyboard shortcuts

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