handler

package
v0.0.0-...-dbbfab9 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultEventInterval = time.Second * 10
)

Variables

This section is empty.

Functions

This section is empty.

Types

type EventChannel

type EventChannel chan event.GenericEvent

Generic event.

type Handler

type Handler struct {
	libweb.StockEventHandler
	// k8s client.
	client.Client
	// contains filtered or unexported fields
}

Provider watch event handler.

func New

func New(
	client client.Client,
	channel chan event.GenericEvent,
	provider *api.Provider) (h *Handler, err error)

Handler factory.

func (*Handler) End

func (r *Handler) End()

Watch ended by peer. The database has been closed.

func (*Handler) Enqueue

func (r *Handler) Enqueue(event event.GenericEvent)

Enqueue reconcile request.

func (*Handler) Error

func (r *Handler) Error(w *libweb.Watch, err error)

Watch error. Repair the watch.

func (*Handler) Inventory

func (r *Handler) Inventory() web.Client

Get an inventory client.

func (*Handler) Match

func (r *Handler) Match(object meta.Object, ref core.ObjectReference) bool

Ref matches object.

func (*Handler) MatchProvider

func (r *Handler) MatchProvider(ref core.ObjectReference) bool

Match provider.

func (*Handler) Provider

func (r *Handler) Provider() *api.Provider

The associated provider.

func (*Handler) Started

func (r *Handler) Started(id uint64)

Inventory watch has parity.

type PeriodicEventGenerator

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

func (*PeriodicEventGenerator) End

func (r *PeriodicEventGenerator) End()

type ProviderMap

type ProviderMap map[types.UID]watchMap

Provider map keyed by provider.UID.

type Stoppable

type Stoppable interface {
	// End the watch.
	End()
}

A stoppable resource.

type WatchManager

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

Watch manager.

func (*WatchManager) Deleted

func (m *WatchManager) Deleted(provider *api.Provider)

A provider has been deleted.

func (*WatchManager) End

func (m *WatchManager) End()

End all watches.

func (*WatchManager) Ensure

func (m *WatchManager) Ensure(
	provider *api.Provider,
	resource interface{},
	handler libweb.EventHandler) (watch *libweb.Watch, err error)

Ensure a watch has been created.

func (*WatchManager) EnsurePeriodicEvents

func (m *WatchManager) EnsurePeriodicEvents(
	provider *api.Provider,
	resource interface{},
	interval time.Duration,
	tickFunc func())

Ensure that we've started a periodic event generator for the provider resource.

Jump to

Keyboard shortcuts

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