keystonefile

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: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExistsKeystoneFile

func ExistsKeystoneFile(wd string) bool

Checks if current execution context contains a keystone.yaml

Types

type CiService

type CiService struct {
	Name    string            `yaml:"name"`
	Type    string            `yaml:"type"`
	Options map[string]string `yaml:"options"`
}

type EnvKey

type EnvKey struct {
	Key    string
	Strict bool
}

type FileKey

type FileKey struct {
	Path      string
	Strict    bool
	FromCache bool `yaml:"-"`
}

type KeystoneFile

type KeystoneFile struct {
	Path string `yaml:"-"`

	ProjectId   string `yaml:"project_id"`
	ProjectName string `yaml:"name"`
	Env         []EnvKey
	Files       []FileKey
	Options     keystoneFileOptions
	CiServices  []CiService `yaml:"ci_services"`
	// contains filtered or unexported fields
}

Represents the contents of the keystone.yaml file

func LoadKeystoneFile

func LoadKeystoneFile(wd string) *KeystoneFile

func NewKeystoneFile

func NewKeystoneFile(wd string, project models.Project) *KeystoneFile

NewKeystoneFile function returns a new instance of a KeyatoneFile

func (*KeystoneFile) AddCiService

func (file *KeystoneFile) AddCiService(ciService CiService) *KeystoneFile

AddCiService method adds a CI service to the keystone file

func (*KeystoneFile) AddFile

func (file *KeystoneFile) AddFile(filekey FileKey) *KeystoneFile

AddFile method adds a tracked file to the keystone file

func (*KeystoneFile) Err

func (file *KeystoneFile) Err() error

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

func (*KeystoneFile) GetCiService

func (file *KeystoneFile) GetCiService(serviceName string) CiService

GetCiService method returns the CI service named `serviceName`

func (*KeystoneFile) HasEnv

func (file *KeystoneFile) HasEnv(varname string) (hasIt bool, strict bool)

HasEnv method returns true the environment variable `varname` exists in the keystone file

func (*KeystoneFile) Load

func (file *KeystoneFile) Load(wd string) *KeystoneFile

Loads a Keystone from disk

func (*KeystoneFile) Remove

func (file *KeystoneFile) Remove() *KeystoneFile

Removes the keystone file from disk

func (*KeystoneFile) RemoveCiService

func (file *KeystoneFile) RemoveCiService(serviceName string) *KeystoneFile

RemoveCiService method removes a CI service from the keystone file

func (*KeystoneFile) RemoveFile

func (file *KeystoneFile) RemoveFile(filepath string) *KeystoneFile

RemoveFile method removes a file from the keysotne file

func (*KeystoneFile) Save

func (file *KeystoneFile) Save() *KeystoneFile

Writes the Keystone File to disk

func (*KeystoneFile) SetEnv

func (file *KeystoneFile) SetEnv(varname string, strict bool) *KeystoneFile

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

func (*KeystoneFile) SetFileRequired

func (file *KeystoneFile) SetFileRequired(
	filepath string,
	required bool,
) *KeystoneFile

SetFileRequired method marks a file a required in the keystone file

func (*KeystoneFile) UnsetEnv

func (file *KeystoneFile) UnsetEnv(varname string) *KeystoneFile

Removes a variable from the project

Jump to

Keyboard shortcuts

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