machineevent

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2024 License: Apache-2.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventRecorder

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

EventRecorder defines an interface for recording events

type EventStore

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

EventStore defines an interface for listing events

type EventStoreOptions

type EventStoreOptions struct {
	MachineEventMaxEvents      int
	MachineEventTTL            time.Duration
	MachineEventResyncInterval time.Duration
}

EventStoreOptions defines options to initialize the machine event store

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(log logr.Logger, 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() []*irievent.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