state

package
v0.0.0-...-01bf647 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2020 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AWS

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

AWS is a state provider type, leveraging S3 and DynamoDB

func NewAWS

func NewAWS(c *config.Config) AWS

NewAWS creates an AWS object

func (*AWS) GetLocks

func (a *AWS) GetLocks() (locks map[string]LockInfo, err error)

GetLocks returns a map of locks by State path

func (*AWS) GetState

func (a *AWS) GetState(st, versionID string) (sf *statefile.File, err error)

GetState retrieves a single State from the S3 bucket

func (*AWS) GetStates

func (a *AWS) GetStates() (states []string, err error)

GetStates returns a slice of State files in the S3 bucket

func (*AWS) GetVersions

func (a *AWS) GetVersions(state string) (versions []Version, err error)

GetVersions returns a slice of Version objects

type GCP

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

GCP is a state provider type, leveraging GCS

func NewGCP

func NewGCP(c *config.Config) (GCP, error)

NewGCP creates an GCP object

func (*GCP) GetLocks

func (a *GCP) GetLocks() (locks map[string]LockInfo, err error)

GetLocks returns a map of locks by State path

func (*GCP) GetState

func (a *GCP) GetState(st, versionID string) (sf *statefile.File, err error)

GetState retrieves a single State from the GCS bucket

func (*GCP) GetStates

func (a *GCP) GetStates() (states []string, err error)

GetStates returns a slice of State files in the GCS bucket

func (*GCP) GetVersions

func (a *GCP) GetVersions(state string) (versions []Version, err error)

GetVersions returns a slice of Version objects

type Lock

type Lock struct {
	LockID string
	Info   string
}

Lock is a single State Lock

type LockInfo

type LockInfo struct {
	ID        string
	Operation string
	Info      string
	Who       string
	Version   string
	Created   *time.Time
	Path      string
}

LockInfo stores information on a State Lock

type Provider

type Provider interface {
	GetLocks() (map[string]LockInfo, error)
	GetVersions(string) ([]Version, error)
	GetStates() ([]string, error)
	GetState(string, string) (*statefile.File, error)
}

Provider is an interface for supported state providers

func Configure

func Configure(c *config.Config) (Provider, error)

Configure the state provider

type TFE

type TFE struct {
	*tfe.Client
	// contains filtered or unexported fields
}

TFE is a state provider type, leveraging Terraform Enterprise

func NewTFE

func NewTFE(c *config.Config) (TFE, error)

NewTFE creates a new TFE object

func (*TFE) GetLocks

func (t *TFE) GetLocks() (locks map[string]LockInfo, err error)

GetLocks returns a map of locks by State path

func (*TFE) GetState

func (t *TFE) GetState(st, versionID string) (sf *statefile.File, err error)

GetState retrieves a single State from the S3 bucket

func (*TFE) GetStates

func (t *TFE) GetStates() (states []string, err error)

GetStates returns a slice of all found workspaces

func (*TFE) GetVersions

func (t *TFE) GetVersions(state string) (versions []Version, err error)

GetVersions returns a slice of Version objects

type Version

type Version struct {
	ID           string
	LastModified time.Time
}

Version is a handler for state versions

Jump to

Keyboard shortcuts

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