statebucket

package
v0.0.34 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicEnvironment

type DynamicEnvironment struct {
	Name        string            `json:"name"`
	Template    string            `json:"template"`
	VersionPins map[string]string `json:"versionPins"`
	Hybrid      bool              `json:"hybrid"` // Deprecated / temporary (while we run bees in hybrid mode)
	Fiab        Fiab              `json:"fiab"`   // Deprecated / temporary (while we run bees in hybrid mode)
}

DynamicEnvironment is a struct for representing a dynamic environment in the state file

type Fiab

type Fiab struct {
	IP   string `json:"ip"`
	Name string `json:"name"`
}

Fiab DEPRECATED struct for representing a Fiab in state file

type StateBucket

type StateBucket interface {
	// Environments returns the list of all environments in the state file
	Environments() ([]DynamicEnvironment, error)
	// Add adds a new environment to the state file
	Add(environment DynamicEnvironment) error
	// PinVersions will update the environment's map of version pins in a merging fashion.
	// For example, if the existing pins are {"A":v100", "B":"v200"}, and PinVersions is called
	// with {"A":"v123"}, the new set of pins will be {"A":"v123", "B":"v200"}. UnpinVersions
	// can be used to remove all version pins for the environment.
	PinVersions(environmentName string, versionPins map[string]string) error
	// UnpinVersions will remove all version pins for an environment.
	UnpinVersions(environmentName string) error
	// Delete will delete an environment from the state file
	Delete(environmentName string) error
	// contains filtered or unexported methods
}

StateBucket is for track state for dynamic environments. (Stored in a GCS bucket)

func New

func New(thelmaConfig config.Config, googleClients google.Clients) (StateBucket, error)

New returns a new statebucket

func NewFake

func NewFake(dir string) (StateBucket, error)

NewFake (FOR USE IN TESTS ONLY) returns a new fake statebucket, backed by local filesystem instead of a GCS bucket

type StateFile

type StateFile struct {
	Environments map[string]DynamicEnvironment `json:"environments"`
}

Jump to

Keyboard shortcuts

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