space

package
v0.0.0-...-6e106ee Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package space manages the settings of space. A space is an environment of which Terraform operates on.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("space not found")

ErrNotFound indicates when a space is not found.

Functions

This section is empty.

Types

type Space

type Space struct {
	Name string

	Backend   []string
	Varfile   []string
	Workspace string
}

Space contains the configuration of each space.

type Spaces

type Spaces []*Space

Spaces is a list of Space.

func (*Spaces) AddBackend

func (s *Spaces) AddBackend(name, backend string)

AddBackend adds backend into the space of name. If the space does not exist, a new one will be created. If the backend already exists in the space, it will not do anything.

func (*Spaces) AddVarfile

func (s *Spaces) AddVarfile(name, varfile string)

AddVarfile adds var-file into the space of name. If the space does not exist, a new one will be created. If the var-file already exists in the space, it will not do anything.

func (*Spaces) Env

func (s *Spaces) Env(name string, hasApply bool) ([]string, error)

Env return list of environment variables in the form of key=value that can be passed to exec.Command.Env.

func (*Spaces) RemoveBackend

func (s *Spaces) RemoveBackend(name, backend string)

RemoveBackend removes backend from the space. If the space does not exist, it does not do anything. If the backend does not exist in the space, it will not do anything.

func (*Spaces) RemoveVarfile

func (s *Spaces) RemoveVarfile(name, varfile string)

RemoveVarfile removes var-file from the space. If the space does not exist, it does not do anything. If the var-file does not exist in the space, it will not do anything.

func (*Spaces) SetWorkspace

func (s *Spaces) SetWorkspace(name, workspace string)

SetWorkspace set the value of workspace to the input value. If space does not exist, if does not do anything.

func (*Spaces) UnsetWorkspace

func (s *Spaces) UnsetWorkspace(name string)

UnsetWorkspace set the value of workspace to empty string. If space does not exist, if does not do anything.

Jump to

Keyboard shortcuts

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