externalcontrollerupdater

package
v0.0.0-...-4308112 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that runs an externalcontrollerupdater worker.

func New

func New(
	externalControllers ExternalControllerUpdaterClient,
	newExternalControllerWatcherClient NewExternalControllerWatcherClientFunc,
	clock clock.Clock,
) (worker.Worker, error)

New returns a new external controller updater worker.

Types

type ExternalControllerUpdaterClient

type ExternalControllerUpdaterClient interface {
	WatchExternalControllers(ctx context.Context) (watcher.StringsWatcher, error)
	ExternalControllerInfo(ctx context.Context, controllerUUID string) (*crossmodel.ControllerInfo, error)
	SetExternalControllerInfo(context.Context, crossmodel.ControllerInfo) error
}

ExternalControllerUpdaterClient defines the interface for watching changes to the local controller's external controller records, and obtaining and updating their values. This will communicate only with the local controller.

type ExternalControllerWatcherClient

type ExternalControllerWatcherClient interface {
	WatchControllerInfo(ctx context.Context) (watcher.NotifyWatcher, error)
	ControllerInfo(ctx context.Context) (*crosscontroller.ControllerInfo, error)
}

ExternalControllerWatcherClient defines the interface for watching changes to and obtaining the current API information for a controller. This will communicate with an external controller.

type ExternalControllerWatcherClientCloser

type ExternalControllerWatcherClientCloser interface {
	ExternalControllerWatcherClient
	io.Closer
}

ExternalControllerWatcherClientCloser extends the ExternalControllerWatcherClient interface with a Close method, for closing the API connection associated with the client.

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string

	NewExternalControllerWatcherClient NewExternalControllerWatcherClientFunc
}

ManifoldConfig describes the resources used by an externalcontrollerupdater worker.

func (ManifoldConfig) Validate

func (cfg ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type NewExternalControllerWatcherClientFunc

type NewExternalControllerWatcherClientFunc func(context.Context, *api.Info) (ExternalControllerWatcherClientCloser, error)

NewExternalControllerWatcherClientFunc is a function type that returns an ExternalControllerWatcherClientCloser, given an *api.Info. The api.Info should be for making a controller-only connection to a remote/external controller.

Jump to

Keyboard shortcuts

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