observer

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory func(cluster string, onSync func()) Observer

Factory is the signature of the observer factory.

type FactoryOut

type FactoryOut struct {
	cell.Out

	Factory Factory `group:"clustermesh-observers"`
}

func NewFactoryOut

func NewFactoryOut(factory Factory) FactoryOut

NewFactoryOut provides the given factory via Hive.

type Name

type Name string

Name represents the name of an observer.

type Observer

type Observer interface {
	// Name returns the name of the observer.
	Name() Name

	// Status returns the status of the observer.
	Status() Status

	// Register registers the observer with the given [store.WatchStoreManager], to
	// watch the desired prefix. If the observer is not enabled (e.g., as not supported
	// according to the remote cluster capabilities), it drains possibly stale data.
	Register(mgr store.WatchStoreManager, backend kvstore.BackendOperations, cfg types.CiliumClusterConfig)

	// Drain emits a deletion event for all previously observed entries, upon
	// disconnection from the target remote cluster.
	Drain()

	// Revoke possibly emits a deletion event for all previously observed entries,
	// if connectivity to the target remote cluster is lost.
	Revoke()
}

Observer knows how to watch a prefix from a given etcd instance.

type Status

type Status struct {
	// Enabled represents whether the observer is currently enabled.
	Enabled bool

	// Synced represents whether the observer retrieved the initial list of entries from etcd.
	Synced bool

	// Entries is the number of entries observed by the given observer.
	Entries uint64
}

Status summarizes the status of an observer.

Jump to

Keyboard shortcuts

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