inventory

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNoSuchTerraformReleaseBuild added in v0.19.0

func IsNoSuchTerraformReleaseBuild(err error) bool

IsNoSuchTerraformReleaseBuild tests if err is an NoSuchTerraformReleaseBuild error.

func IsOsArchUnsupportedByTerraform added in v0.19.0

func IsOsArchUnsupportedByTerraform(err error) bool

IsOsArchUnsupportedByTerraform tests if err is an OsArchUnsupportedByTerraform error.

func NewNoSuchTerraformReleaseBuild added in v0.19.0

func NewNoSuchTerraformReleaseBuild() error

NewNoSuchTerraformReleaseBuild creates a new error.

func NewOsArchUnsupportedByTerraform added in v0.19.0

func NewOsArchUnsupportedByTerraform() error

NewOsArchUnsupportedByTerraform creates a new error.

Types

type Inventory

type Inventory struct {
	LastUpdateTime    time.Time
	TerraformReleases map[string]*statePkg.TerraformReleaseState
	// contains filtered or unexported fields
}

Inventory represents the tfvm inventory on disk. An inventory stores terraform versions and a statePkg.json inventory statePkg file.

func GetInventory

func GetInventory() (*Inventory, error)

GetInventory initializes an inventory instance representing the inventory of the current machine.

func NewInventory added in v0.19.0

func NewInventory() (*Inventory, error)

NewInventory creates a new empty inventory instance.

func (*Inventory) GetCacheDir added in v0.17.0

func (inventory *Inventory) GetCacheDir() string

GetCacheDir gives the cache dir path of the inventory.

func (*Inventory) GetInstalledTerraform added in v0.19.0

func (inventory *Inventory) GetInstalledTerraform(terraformVersion *version.TerraformVersion) (*Terraform, error)

GetInstalledTerraform installs a terraform version by downloading and extracting it. GetInstalledTerraform respects the platform and fallbacks.

func (*Inventory) GetLatestRelease

func (inventory *Inventory) GetLatestRelease() (*version.TerraformVersion, error)

GetLatestRelease returns the newest terraform version known.

func (*Inventory) GetMatchingTerraformRelease added in v0.19.0

func (inventory *Inventory) GetMatchingTerraformRelease(versionSpec *version.TerraformVersionSpec) (*state.TerraformReleaseState, error)

GetMatchingTerraformRelease returns the terraform version for a version specification.

func (*Inventory) GetPrimaryPlatform added in v0.19.0

func (inventory *Inventory) GetPrimaryPlatform() platform.Platform

GetPrimaryPlatform retrieves the primary platform.

func (*Inventory) GetTerraform

func (inventory *Inventory) GetTerraform(tfRelease *version.TerraformVersion, platform platformPkg.Platform) (*Terraform, error)

GetTerraform get reference to a terraform installation of a given version.

func (*Inventory) GetTerraformBasePath

func (inventory *Inventory) GetTerraformBasePath(tfRelease *version.TerraformVersion, platform platformPkg.Platform) (string, error)

GetTerraformBasePath returns the base path for a terraform installation.

func (*Inventory) GetTerraformRelease

func (inventory *Inventory) GetTerraformRelease(tfReleaseVersion *version.TerraformVersion) (*state.TerraformReleaseState, error)

GetTerraformRelease returns the terraform version.

func (*Inventory) GetTerraformReleasesAsc

func (inventory *Inventory) GetTerraformReleasesAsc() []*version.TerraformVersion

GetTerraformReleasesAsc lists terraform versions known in ascending order.

func (*Inventory) InstallTerraform

func (inventory *Inventory) InstallTerraform(terraformVersion *version.TerraformVersion, platform platformPkg.Platform) (*Terraform, error)

InstallTerraform installs a terraform version for an particular os and arch.

func (*Inventory) IsTerraformInstalled

func (inventory *Inventory) IsTerraformInstalled(tfRelease *version.TerraformVersion, platform platformPkg.Platform) (bool, error)

IsTerraformInstalled answers if a particular terraform version is already installed locally.

func (*Inventory) IsTerraformInstalledOnAnyPlatform added in v0.20.0

func (inventory *Inventory) IsTerraformInstalledOnAnyPlatform(tfRelease *version.TerraformVersion) (bool, error)

IsTerraformInstalledOnAnyPlatform answers if a particular terraform version is already installed locally.

func (*Inventory) Load added in v0.19.0

func (inventory *Inventory) Load() error

Load loads the inventory state from an optionally present state file and merges it with the current state.

func (*Inventory) Save added in v0.19.0

func (inventory *Inventory) Save() error

Save saves the inventory state into the state.json file in an atomic way.

func (*Inventory) Update

func (inventory *Inventory) Update() error

Update updates the inventory state.

func (*Inventory) UpdateTerraformRelease added in v0.21.0

func (inventory *Inventory) UpdateTerraformRelease(tfReleaseState *state.TerraformReleaseState) error

UpdateTerraformRelease updates the build meta data of a terraform release.

func (*Inventory) WriteTo added in v0.19.0

func (inventory *Inventory) WriteTo(w io.Writer) (int64, error)

WriteTo writes the inventory state to writer w.

type Terraform

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

Terraform is a version of terraform installed into the local inventory.

func (*Terraform) Run

func (terraform *Terraform) Run(args ...string) (int, error)

Run calls terraform with args.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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