Documentation ¶
Index ¶
Constants ¶
View Source
const EventsManagerServiceLocalID = "updatem.service.local.v1.service-events-manager"
EventsManagerServiceLocalID is the ID used by the service in the local services registry
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { // the EventType Type EventType `json:"type"` // the EventAction Action EventAction `json:"action"` // the instance that changed Source interface{} `json:"source,omitempty"` // time Time int64 `json:"time,omitempty"` // event context Context context.Context `json:"context"` // error information about the event Error error `json:"error"` }
Event represents an emitted event
type EventAction ¶
type EventAction string
EventAction represents the event's action
const ( // EventActionResourcesAdded is used when a Pod or Node resource is added EventActionResourcesAdded EventAction = "added" // EventActionResourcesUpdated is used when a Pod or Node resource is updated EventActionResourcesUpdated EventAction = "updated" // EventActionResourcesDeleted is used when a Pod or Node resource is deleted EventActionResourcesDeleted EventAction = "deleted" )
type EventType ¶
type EventType string
EventType represents the event's type
const ( // EventTypeResources is an event type for the resources EventTypeResources EventType = "resources" )
type UpdateEventsManager ¶
type UpdateEventsManager interface { // Publish adds a new event to be dispatched based on the provided EventType and EventAction Publish(ctx context.Context, event *Event) error // Subscribe provides two channels where the according events and errors can be received via the subscriber context provided Subscribe(ctx context.Context) (<-chan *Event, <-chan error) }
UpdateEventsManager provies a simple way of publishing and subscribing to update manager related events.
Click to show internal directories.
Click to hide internal directories.