events

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ListenerStoppedErr = errors.New("listener closed")

Functions

This section is empty.

Types

type Emitter

type Emitter interface {
	Send(Event)
}

type Event

type Event interface{}

type EventBus

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

func NewEventBus

func NewEventBus() *EventBus

func (*EventBus) New

func (b *EventBus) New() Listener

func (*EventBus) Send

func (b *EventBus) Send(event Event)

type Listener

type Listener interface {
	Recv(stop <-chan struct{}) (Event, error)
}

type ListenerFactory

type ListenerFactory interface {
	New() Listener
}

type Op

type Op int
const (
	Create Op = iota
	Update
	Delete
)

type ResourceChangedEvent

type ResourceChangedEvent struct {
	Operation Op
	Type      model.ResourceType
	Key       model.ResourceKey
}

Jump to

Keyboard shortcuts

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