Documentation ¶
Index ¶
- func ExistsEnvironmentsFile(dotKeystonePath string) bool
- type Env
- type EnvironmentsFile
- func (file *EnvironmentsFile) Err() error
- func (file *EnvironmentsFile) GetByName(environmentName string) *Env
- func (file *EnvironmentsFile) Load(dotKeystonePath string) *EnvironmentsFile
- func (file *EnvironmentsFile) Path() string
- func (file *EnvironmentsFile) Remove()
- func (file *EnvironmentsFile) Replace(environment models.Environment) *EnvironmentsFile
- func (file *EnvironmentsFile) Save() *EnvironmentsFile
- func (file *EnvironmentsFile) SetCurrent(environmentName string) *EnvironmentsFile
- func (file *EnvironmentsFile) SetVersion(environmentName string, versionID string) *EnvironmentsFile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExistsEnvironmentsFile ¶
Checks if current execution context contains a keystone.yaml
Types ¶
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