Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
func NewWorker ¶
NewWorker returns a worker that will attempt to discover the configured Environ's spaces, and update the controller via the configured Facade. Names are sanitised with NewName, and any supplied Unlocker will be Unlock()ed when the first complete discovery and update succeeds.
Once that update completes, the worker just waits to be Kill()ed. We should probably poll for changes, really, but I'm making an effort to preserve existing behaviour where possible.
Types ¶
type Config ¶
type Config struct { // Facade exposes the capabilities of a controller. Facade Facade // Environ exposes the capabilities of a compute substrate. Environ environs.Environ // NewName is used to sanitise, and make unique, space names as // reported by an Environ (for use in juju, via the Facade). You // should probably set it to ConvertSpaceName. NewName NameFunc // Unlocker, if not nil, will be unlocked when the first discovery // attempt completes successfully. Unlocker gate.Unlocker }
Config defines the operation of a space discovery worker.
type Facade ¶
type Facade interface { CreateSpaces(params.CreateSpacesParams) (params.ErrorResults, error) AddSubnets(params.AddSubnetsParams) (params.ErrorResults, error) ListSpaces() (params.DiscoverSpacesResults, error) ListSubnets(params.SubnetsFilters) (params.ListSubnetsResults, error) }
Facade exposes the relevant capabilities of a *discoverspaces.API; it's a bit raw but at least it's easily mockable.
type ManifoldConfig ¶
Click to show internal directories.
Click to hide internal directories.