juju: github.com/wallyworld/juju/environs/space Index | Files

package space

import "github.com/wallyworld/juju/environs/space"


Package Files

spaces.go state.go

func NewState Uses

func NewState(st *state.State) *spaceStateShim

NewState creates a space state shim.

func ReloadSpaces Uses

func ReloadSpaces(ctx context.ProviderCallContext, state ReloadSpacesState, environ environs.BootstrapEnviron) error

ReloadSpaces loads spaces and subnets from provider specified by environ into state. Currently it's an append-only operation, no spaces/subnets are deleted.

type Constraints Uses

type Constraints interface{}

Constraints defines the methods supported by constraints used in the space context.

type ProviderSpaces Uses

type ProviderSpaces struct {
    // contains filtered or unexported fields

ProviderSpaces defines a set of operations to perform when dealing with provider spaces. SaveSpaces, DeleteSpaces are operations for setting state in the persistence layer.

func NewProviderSpaces Uses

func NewProviderSpaces(st ReloadSpacesState) *ProviderSpaces

NewProviderSpaces creates a new ProviderSpaces to perform a series of operations.

func (*ProviderSpaces) DeleteSpaces Uses

func (s *ProviderSpaces) DeleteSpaces() ([]string, error)

DeleteSpaces will attempt to delete any unused spaces after a SaveSpaces has been called. If there are no spaces to be deleted, it will exit out early.

func (*ProviderSpaces) DeltaSpaces Uses

func (s *ProviderSpaces) DeltaSpaces() network.IDSet

DeltaSpaces returns all the spaces that haven't been updated.

func (*ProviderSpaces) SaveSpaces Uses

func (s *ProviderSpaces) SaveSpaces(providerSpaces []network.SpaceInfo) error

SaveSpaces consumes provider spaces and saves the spaces as subnets on a provider.

type ReloadSpacesState Uses

type ReloadSpacesState interface {
    // AllSpaces returns all spaces for the model.
    AllSpaces() ([]Space, error)
    // AddSpace creates and returns a new space.
    AddSpace(string, network.Id, []string, bool) (Space, error)
    // SaveProviderSubnets loads subnets into state.
    SaveProviderSubnets([]network.SubnetInfo, string) error
    // ConstraintsBySpaceName returns all Constraints that include a positive
    // or negative space constraint for the input space name.
    ConstraintsBySpaceName(string) ([]Constraints, error)
    // DefaultEndpointBindingSpace returns the current space ID to be used for
    // the default endpoint binding.
    DefaultEndpointBindingSpace() (string, error)
    // AllEndpointBindingsSpaceNames returns a set of spaces names for all the
    // endpoint bindings.
    AllEndpointBindingsSpaceNames() (set.Strings, error)

ReloadSpacesState defines an in situ point of use type for ReloadSpaces

type Space Uses

type Space interface {
    Id() string
    Name() string
    ProviderId() network.Id
    Life() state.Life
    EnsureDead() error
    Remove() error

Space represents a space that saved to state.

Package space imports 9 packages (graph). Updated 2020-08-15. Refresh now. Tools for package owners.