state

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

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 27 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(aws config.AWSConfig, bucket config.S3BucketConfig, noLocks, noVersioning bool) *AWS

NewAWS creates an AWS object

func NewAWSCollection

func NewAWSCollection(c *config.Config) []*AWS

NewAWSCollection instantiate all needed AWS objects configurated by the user and return a slice

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(gcp config.GCPConfig, noLocks, noVersioning bool) (*GCP, error)

NewGCP creates an GCP object

func NewGCPCollection

func NewGCPCollection(c *config.Config) ([]*GCP, error)

NewGCPCollection instantiate all needed GCP objects configurated by the user and return a slice

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 Gitlab

type Gitlab struct {
	Client gitlab.Client
	// contains filtered or unexported fields
}

Gitlab is a state provider type, leveraging GitLab

func NewGitlab

func NewGitlab(gl config.GitlabConfig, noLocks, noVersioning bool) *Gitlab

NewGitlab creates a new Gitlab object

func NewGitlabCollection

func NewGitlabCollection(c *config.Config) []*Gitlab

NewGitlabCollection instantiate all needed Gitlab objects configurated by the user and return a slice

func (*Gitlab) GetLocks

func (g *Gitlab) GetLocks() (locks map[string]LockInfo, err error)

GetLocks returns a map of locks by State path

func (*Gitlab) GetState

func (g *Gitlab) GetState(path, version string) (sf *statefile.File, err error)

GetState retrieves a single state file from the GitLab API

func (*Gitlab) GetStates

func (g *Gitlab) GetStates() (states []string, err error)

GetStates returns a slice of all found workspaces

func (*Gitlab) GetVersions

func (g *Gitlab) 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(tfeObj config.TFEConfig, noLocks, noVersioning bool) (*TFE, error)

NewTFE creates a new TFE object

func NewTFECollection

func NewTFECollection(c *config.Config) ([]*TFE, error)

NewTFECollection instantiate all needed GCP objects configurated by the user and return a slice

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