state

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State struct {
	LastUpdateTime    time.Time                `json:"lastUpdateTime"`
	TerraformReleases []*TerraformReleaseState `json:"terraformReleases"`
}

State describes the on disk inventory state format.

func GetDefaultState

func GetDefaultState() (*State, error)

GetDefaultState retrieves the default state.

func NewEmptyState

func NewEmptyState() *State

NewEmptyState create a new empty state.

func (*State) LoadFromFile

func (state *State) LoadFromFile(statefilepath string) error

LoadFromFile loads the json from statefilepath into the state struct.

func (*State) Marshall

func (state *State) Marshall() ([]byte, error)

Marshall converts state into json on disk format.

func (*State) ToJSON

func (state *State) ToJSON() (string, error)

ToJSON converts state to json representation.

func (*State) WriteTo

func (state *State) WriteTo(w io.Writer) (int64, error)

WriteTo writes the state as json to writer w.

type TerraformReleaseBuildState

type TerraformReleaseBuildState struct {
	Os             string `json:"os"`
	Arch           string `json:"arch"`
	DownloadPath   string `json:"download_path"`
	SHA256Checksum string `json:"sha256_checksum"`
}

TerraformReleaseBuildState describes a single terraform release build state.

type TerraformReleaseState

type TerraformReleaseState struct {
	Version *version.TerraformVersion     `json:"version"`
	Builds  []*TerraformReleaseBuildState `json:"builds"`
}

TerraformReleaseState describes a single terraform release state.

func (*TerraformReleaseState) AddMissingBuilds

func (terraformRelease *TerraformReleaseState) AddMissingBuilds(newBuilds []*remote.TerraformBuild) error

AddMissingBuilds adds missing builds.

func (*TerraformReleaseState) AddMissingChecksums added in v0.21.0

func (terraformRelease *TerraformReleaseState) AddMissingChecksums(sha256ChecksumsByPlatform map[string]big.Int) error

AddMissingChecksums adds missing checksums.

func (*TerraformReleaseState) ContainsBuild

func (terraformRelease *TerraformReleaseState) ContainsBuild(os string, arch string) bool

ContainsBuild answers if a terraform contains build information about an build for os and arch.

func (*TerraformReleaseState) MergeIn

func (terraformRelease *TerraformReleaseState) MergeIn(other *TerraformReleaseState)

MergeIn merges the given release state into the inventory state.

Jump to

Keyboard shortcuts

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