cnr

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CNRFetcher

type CNRFetcher interface {
	// GetCNR returns those latest custom node resources metadata.
	GetCNR(ctx context.Context) (*nodev1alpha1.CustomNodeResource, error)

	// RegisterNotifier registers a notifier to be notified when CNR is updated.
	RegisterNotifier(name string, notifier CNRNotifier) error

	// UnregisterNotifier unregisters a notifier.
	UnregisterNotifier(name string) error
}

CNRFetcher is used to get CNR information.

func NewCachedCNRFetcher added in v0.2.0

type CNRFetcherStub added in v0.2.0

type CNRFetcherStub struct {
	CNR *v1alpha1.CustomNodeResource
}

func (*CNRFetcherStub) GetCNR added in v0.2.0

func (*CNRFetcherStub) RegisterNotifier added in v0.2.0

func (c *CNRFetcherStub) RegisterNotifier(_ string, _ CNRNotifier) error

func (*CNRFetcherStub) UnregisterNotifier added in v0.2.0

func (c *CNRFetcherStub) UnregisterNotifier(_ string) error

type CNRNotifier added in v0.2.0

type CNRNotifier interface {
	// OnCNRUpdate is called when CNR is updated.
	OnCNRUpdate(cnr *nodev1alpha1.CustomNodeResource)

	// OnCNRStatusUpdate is called when CNR status is updated.
	OnCNRStatusUpdate(cnr *nodev1alpha1.CustomNodeResource)
}

CNRNotifier is used to notify CNR update.

type CNRNotifierStub added in v0.2.0

type CNRNotifierStub struct{}

CNRNotifierStub is a stub implementation of CNRNotifier.

func (CNRNotifierStub) OnCNRStatusUpdate added in v0.2.0

func (C CNRNotifierStub) OnCNRStatusUpdate(cnr *v1alpha1.CustomNodeResource)

OnCNRStatusUpdate is called when CNR status is updated.

func (CNRNotifierStub) OnCNRUpdate added in v0.2.0

func (C CNRNotifierStub) OnCNRUpdate(cnr *v1alpha1.CustomNodeResource)

OnCNRUpdate is called when CNR is updated.

Jump to

Keyboard shortcuts

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