Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventRecorder ¶
type EventRecorder interface {
Eventf(apiMetadata api.Metadata, eventType, reason, action, messageFormat string, args ...any)
}
EventRecorder defines an interface for recording events.
The action argument names the operation the reporter performed (e.g. "Destroy", "AttachVolume", "Pull") and is distinct from reason, which names the outcome. It must be non-empty: downstream consumers publish events into the events.k8s.io/v1 API where action is a required field.
type EventStore ¶
type EventStore interface {
ListEvents() []*Event
}
EventStore defines an interface for listing events
type EventStoreOptions ¶
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, action, messageFormat string, args ...any)
Eventf logs and records an event with formatted message.
func (*Store) ListEvents ¶
ListEvents returns a copy of all events currently in the store.