event

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: 9 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 Event

type Event[E api.Object] struct {
	Type   Type
	Object E
}

type Handler

type Handler[e api.Object] interface {
	Handle(event Event[e])
}

type HandlerFunc

type HandlerFunc[E api.Object] func(event Event[E])

func (HandlerFunc[E]) Handle

func (f HandlerFunc[E]) Handle(event Event[E])

type HandlerRegistration

type HandlerRegistration interface{}

type ListWatchSource

type ListWatchSource[E api.Object] struct {
	// contains filtered or unexported fields
}

func NewListWatchSource

func NewListWatchSource[E api.Object](listFunc func(ctx context.Context) ([]E, error), watchFunc func(ctx context.Context) (store.Watch[E], error), opts ListWatchSourceOptions) (*ListWatchSource[E], error)

func (*ListWatchSource[E]) AddHandler

func (s *ListWatchSource[E]) AddHandler(handler Handler[E]) (HandlerRegistration, error)

func (*ListWatchSource[E]) RemoveHandler

func (s *ListWatchSource[E]) RemoveHandler(registration HandlerRegistration) error

func (*ListWatchSource[E]) Start

func (s *ListWatchSource[E]) Start(ctx context.Context) error

type ListWatchSourceOptions

type ListWatchSourceOptions struct {
	ResyncDuration time.Duration
}

type Source

type Source[E api.Object] interface {
	AddHandler(handler Handler[E]) (HandlerRegistration, error)
	RemoveHandler(registration HandlerRegistration) error
}

type Type

type Type string
const (
	TypeCreated Type = "Created"
	TypeUpdated Type = "Updated"
	TypeDeleted Type = "Deleted"
	TypeGeneric Type = "Generic"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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