event

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2025 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DigestForEvent

func DigestForEvent(ev Event) string

digestForEvent generates a hash digest for a given event. It uses the Murmur3 hashing algorithm to create a 64-bit hash value. The event is first cleaned and then converted to a byte slice before hashing. The resulting hash is returned as a hexadecimal string.

Parameters: - ev: The event for which the digest is to be generated.

Returns: - A hexadecimal string representing the hash digest of the event.

Types

type Action added in v0.2.2

type Action string
const (
	OnChange Action = "OnChange"
	OnDelete Action = "OnDelete"
	OnCreate Action = "OnCreate"
	OnAny    Action = "OnAny"
)

type ActionCustomResource added in v0.2.7

type ActionCustomResource string
const (
	CRCreated  ActionCustomResource = "Create"
	CRUpdated  ActionCustomResource = "Update"
	CRDeleted  ActionCustomResource = "Delete"
	CRObserved ActionCustomResource = "Observe"
)

type ActionsEvent added in v0.2.7

type ActionsEvent map[ActionCustomResource]EventType

func NewDefaultActionsEvent added in v0.2.7

func NewDefaultActionsEvent() ActionsEvent

func (ActionsEvent) GetEventType added in v0.2.7

func (ae ActionsEvent) GetEventType(action ActionCustomResource) EventType

GetEventType returns the stored value when present, otherwise returns the package default. It never mutates the caller.

func (*ActionsEvent) MutateEvent added in v0.2.7

func (ae *ActionsEvent) MutateEvent(action ActionCustomResource, eventType EventType)

Use pointer receiver so we can allocate and modify the caller's map

type AnnotationEvent added in v0.2.2

type AnnotationEvent struct {
	EventType  EventType `json:"eventType"`
	Annotation string    `json:"annotation"`
	OnAction   Action    `json:"onAction"`
}

type AnnotationEvents added in v0.2.2

type AnnotationEvents []AnnotationEvent

This is a list of annotation events. It is used to store events that are triggered by annotations in the resource. The list is used to determine which events to trigger based on the annotations present in the resource.

func NewAnnotationEvents added in v0.2.2

func NewAnnotationEvents(evts ...AnnotationEvent) AnnotationEvents

func (*AnnotationEvents) Add added in v0.2.2

func (ae *AnnotationEvents) Add(eventType EventType, annotation string, action Action, overwrite bool)

Add adds an event with optional overwrite capability

func (AnnotationEvents) HasAnnotation added in v0.2.2

func (ae AnnotationEvents) HasAnnotation(annotation string) bool

func (*AnnotationEvents) Remove added in v0.2.2

func (ae *AnnotationEvents) Remove(annotation string)

Remove removes all events with the specified annotation

type Event

type Event struct {
	EventType EventType
	ObjectRef objectref.ObjectRef
	QueuedAt  time.Time
}

func (Event) CompareTo added in v0.2.5

func (e Event) CompareTo(other Event) int

type EventType

type EventType string
const (
	Observe EventType = "Observe"
	Create  EventType = "Create"
	Update  EventType = "Update"
	Delete  EventType = "Delete"
)

Jump to

Keyboard shortcuts

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