event

package
v0.0.0-...-832932f Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventBroadcaster

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

EventBroadcaster is a component that can broadcast resource status change events to registered clients.

func NewEventBroadcaster

func NewEventBroadcaster() *EventBroadcaster

NewEventBroadcaster creates a new event broadcaster.

func (*EventBroadcaster) Broadcast

func (h *EventBroadcaster) Broadcast(res *api.Resource)

Broadcast broadcasts a resource status change event to all registered clients.

func (*EventBroadcaster) Register

func (h *EventBroadcaster) Register(source string, handler resourceHandler) (string, <-chan error)

Register registers a client and return client id and error channel.

func (*EventBroadcaster) Start

func (h *EventBroadcaster) Start(ctx context.Context)

Start starts the event broadcaster and waits for events to broadcast.

func (*EventBroadcaster) Unregister

func (h *EventBroadcaster) Unregister(id string)

Unregister unregisters a client by id

Jump to

Keyboard shortcuts

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