event

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2024 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Overview

event package contains the event structure to encapsulate what is happening during the client apply process. the events can be used to log the status directly to the user or cancelling the excution if some error is found.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyInfo

type ApplyInfo struct {
	Object *unstructured.Unstructured
	Status Status
	Error  error
}

func (ApplyInfo) String

func (i ApplyInfo) String() string

type ErrorInfo

type ErrorInfo struct {
	Error error
}

func (ErrorInfo) String

func (i ErrorInfo) String() string

type Event

type Event struct {
	Type Type

	// ErrorInfo contains info for a TypeError event
	ErrorInfo ErrorInfo

	// QueueInfo contains info for a TypeQueue event
	QueueInfo QueueInfo

	// ApplyInfo contains info for a TypeApply event
	ApplyInfo ApplyInfo

	// PruneInfo contains info for a PruneInfo event
	PruneInfo PruneInfo

	// InventoryInfo contains info for a TypeInventory event
	InventoryInfo InventoryInfo

	// StatusUpdateInfo contains info for a TypeStatusUpdate event
	StatusUpdateInfo StatusUpdateInfo
}

Event is the basic block for encapsulate the progression of a task or queue during its execution, more state can be encapsulated extending this struct but

func (Event) IsErrorEvent

func (e Event) IsErrorEvent() bool

IsErrorEvent can be used to check if the error contains some type of error

func (Event) String

func (e Event) String() string

String can be used for logging, the base struct will only print what type of event this is and the error if available

type InventoryInfo

type InventoryInfo struct {
	Status Status
	Error  error
}

func (InventoryInfo) String

func (i InventoryInfo) String() string

type PruneInfo

type PruneInfo struct {
	Object *unstructured.Unstructured
	Status Status
	Error  error
}

func (PruneInfo) String

func (i PruneInfo) String() string

type QueueInfo

type QueueInfo struct {
	Objects []*unstructured.Unstructured
}

func (QueueInfo) String

func (i QueueInfo) String() string

type Status

type Status int

Status determine the status of events that are available.

const (
	StatusPending Status = iota
	StatusSuccessful
	StatusFailed
	StatusSkipped
)

func (Status) String

func (i Status) String() string

type StatusUpdateInfo

type StatusUpdateInfo struct {
	Status         Status
	Message        string
	ObjectMetadata resource.ObjectMetadata
}

func (StatusUpdateInfo) String

func (i StatusUpdateInfo) String() string

type Type

type Type int

Type determines the type of events that are available.

const (
	TypeError Type = iota
	TypeQueue
	TypeApply
	TypePrune
	TypeInventory
	TypeStatusUpdate
)

func (Type) String

func (i Type) String() string

Jump to

Keyboard shortcuts

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