operation

package
v0.0.0-...-44f2bf6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Item

type Item struct {
	Operation Operation

	Group   string
	Version string
	Kind    string

	Namespace string
	Name      string
}

Item defines action in operator

func NewItem

func NewItem(operation Operation, group, version, kind, namespace, name string) (Item, error)

NewItem creates new Item

func NewItemFromGVKObject

func NewItemFromGVKObject(operation Operation, gvk schema.GroupVersionKind, object meta.Object) (Item, error)

NewItemFromGVKObject creates new item from Kubernetes Object

func NewItemFromObject

func NewItemFromObject(operation Operation, group, version, kind string, object meta.Object) (Item, error)

NewItemFromObject creates new item from Kubernetes Object

func NewItemFromString

func NewItemFromString(itemString string) (Item, error)

NewItemFromString creates new item from String

func (Item) GVK

func (i Item) GVK(gvk schema.GroupVersionKind) bool

func (Item) String

func (i Item) String() string

func (Item) Validate

func (i Item) Validate() error

Validate item if all required fields are set

func (Item) WrapLogger

func (i Item) WrapLogger(in *zerolog.Event) *zerolog.Event

type Operation

type Operation string

Operation declares operation string representation

const (
	// Add define operation generated when object was created
	Add Operation = "ADD"
	// Update define operation generated when object was updated
	Update Operation = "UPDATE"
	// Delete define operation generated when object was deleted
	Delete Operation = "DELETE"
)

Jump to

Keyboard shortcuts

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