environmentsfile

package
v0.0.0-...-4df811a Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistsEnvironmentsFile

func ExistsEnvironmentsFile(dotKeystonePath string) bool

Checks if current execution context contains a keystone.yaml

Types

type Env

type Env struct {
	EnvironmentID string `yaml:"id"`
	Name          string `yaml:"name"`
	VersionID     string `yaml:"version_id"`
}

type EnvironmentsFile

type EnvironmentsFile struct {
	Current      string `yaml:"current" default:"dev"`
	Environments []Env  `yaml:"environments"`
	// contains filtered or unexported fields
}

func NewEnvironmentsFile

func NewEnvironmentsFile(dotKeystonePath string, updatedEnvironments []models.Environment) *EnvironmentsFile

NewEnvironmentsFile function returns a new instance of EnvironmentsFile

func (*EnvironmentsFile) Err

func (file *EnvironmentsFile) Err() error

Accessor for the EnvironmentsFile's err field use for error management

func (*EnvironmentsFile) GetByName

func (file *EnvironmentsFile) GetByName(environmentName string) *Env

GetByName method returns an environment named `environmentName` from the environmentfile, or nil if theres no such environment

func (*EnvironmentsFile) Load

func (file *EnvironmentsFile) Load(dotKeystonePath string) *EnvironmentsFile

Loads a Keystone from disk

func (*EnvironmentsFile) Path

func (file *EnvironmentsFile) Path() string

Path method returns the path to the environment file

func (*EnvironmentsFile) Remove

func (file *EnvironmentsFile) Remove()

Removes the environments file from disk

func (*EnvironmentsFile) Replace

func (file *EnvironmentsFile) Replace(environment models.Environment) *EnvironmentsFile

Replaces an environment in the environment file with updated data If the environment does not exist in the environment file, it should be appended to it

func (*EnvironmentsFile) Save

func (file *EnvironmentsFile) Save() *EnvironmentsFile

Writes the Keystone File to disk

func (*EnvironmentsFile) SetCurrent

func (file *EnvironmentsFile) SetCurrent(environmentName string) *EnvironmentsFile

SetCurrent method sets the current environment in the environmentsfile

func (*EnvironmentsFile) SetVersion

func (file *EnvironmentsFile) SetVersion(environmentName string, versionID string) *EnvironmentsFile

Adds a variable to the project set strict to true if you want to throw an error when it is missing

Jump to

Keyboard shortcuts

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