externalcontrollerupdater

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 16 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() (watcher.StringsWatcher, error)
	ExternalControllerInfo(controllerUUID string) (*crossmodel.ControllerInfo, error)
	SetExternalControllerInfo(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() (watcher.NotifyWatcher, error)
	ControllerInfo() (*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(*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