proxyupdater

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type API

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

API provides the ProxyUpdater version 2 facade.

func NewAPIV2

func NewAPIV2(
	controller ControllerBackend,
	controllerConfigService ControllerConfigService,
	modelConfigService ModelConfigService,
	resources facade.Resources,
	authorizer facade.Authorizer,
) (*API, error)

NewAPIV2 creates a new server-side API facade with the given Backing.

func (*API) ProxyConfig

func (api *API) ProxyConfig(ctx context.Context, args params.Entities) params.ProxyConfigResults

ProxyConfig returns the proxy settings for the current model.

func (*API) WatchForProxyConfigAndAPIHostPortChanges

func (api *API) WatchForProxyConfigAndAPIHostPortChanges(ctx context.Context, args params.Entities) params.NotifyWatchResults

WatchForProxyConfigAndAPIHostPortChanges watches for changes to the proxy and api host port settings.

type ControllerBackend

type ControllerBackend interface {
	APIHostPortsForAgents(controller.Config) ([]network.SpaceHostPorts, error)
	WatchAPIHostPortsForAgents() state.NotifyWatcher
}

ControllerBackend defines the controller state methods this facade needs, so they can be mocked for testing.

type ControllerConfigService

type ControllerConfigService interface {
	// ControllerConfig returns the config values for the controller.
	ControllerConfig(context.Context) (controller.Config, error)
}

ControllerConfigService represents a way to get controller config.

type ModelConfigService

type ModelConfigService interface {
	// ModelConfig returns the current config for the model.
	ModelConfig(context.Context) (*config.Config, error)
	// Watch returns a watcher that returns keys for any changes to model
	// config.
	Watch() (watcher.StringsWatcher, error)
}

ModelConfigService provides access to the model's configuration.

type ProxyUpdaterV2

type ProxyUpdaterV2 interface {
	ProxyConfig(ctx context.Context, args params.Entities) params.ProxyConfigResults
	WatchForProxyConfigAndAPIHostPortChanges(ctx context.Context, args params.Entities) params.NotifyWatchResults
}

ProxyUpdaterV2 defines the public methods for the v2 facade.

Jump to

Keyboard shortcuts

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