recorder

package
v0.0.0-...-358ca0e Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Event

type Event struct {
	InvolvedObjectMeta api.Metadata
	Type               string
	Reason             string
	Message            string
	EventTime          int64
}

type EventRecorder

type EventRecorder interface {
	Eventf(apiMetadata api.Metadata, eventType string, reason string, messageFormat string, args ...any)
}

EventRecorder defines an interface for recording events

type EventStore

type EventStore interface {
	ListEvents() []*Event
}

EventStore defines an interface for listing events

type EventStoreOptions

type EventStoreOptions struct {
	MaxEvents      int
	TTL            time.Duration
	ResyncInterval time.Duration
}

EventStoreOptions defines options to initialize the machine event store

func (*EventStoreOptions) Defaults

func (o *EventStoreOptions) Defaults()

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store implements the EventRecorder and EventStore interface and represents an in-memory event store with TTL for events.

func NewEventStore

func NewEventStore(log logr.Logger, opts EventStoreOptions) *Store

NewEventStore creates a new EventStore with a fixed number of events and set TTL for events.

func (*Store) Eventf

func (es *Store) Eventf(apiMetadata api.Metadata, eventType, reason, messageFormat string, args ...any)

Eventf logs and records an event with formatted message.

func (*Store) ListEvents

func (es *Store) ListEvents() []*Event

ListEvents returns a copy of all events currently in the store.

func (*Store) Start

func (es *Store) Start(ctx context.Context)

Start initializes and starts the event store's TTL expiration check.

Jump to

Keyboard shortcuts

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