space

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: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewState

func NewState(st *state.State) *spaceStateShim

NewState creates a space state shim.

func ReloadSpaces

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

Types

type Constraints

type Constraints interface{}

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

type ProviderSpaces

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

func NewProviderSpaces(st ReloadSpacesState) *ProviderSpaces

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

func (*ProviderSpaces) DeleteSpaces

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

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

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

func (*ProviderSpaces) SaveSpaces

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

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

type ReloadSpacesState

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

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.

Jump to

Keyboard shortcuts

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