Documentation
¶
Index ¶
Constants ¶
const DefaultSessionValidity = 1800
DefaultSessionValidity is the default for the --session-validity flag
const VarsDescription = `` /* 899-byte string literal not displayed */
VarsDescription is text suitable for inclusion in commands that manipulate config variables.
Variables ¶
This section is empty.
Functions ¶
func IsConfigVar ¶
IsConfigVar checks to see if the named variable is actually one of the settable configVars.
Types ¶
type CannotLoadDefinitionsError ¶
type CannotLoadDefinitionsError struct {
Err error
}
CannotLoadDefinitionsError is unused. Planned to be used if bytemark-client starts caching definitions, but it doesn't at the moment.
func (*CannotLoadDefinitionsError) Error ¶
func (e *CannotLoadDefinitionsError) Error() string
type DirInvalidError ¶
type DirInvalidError struct {
Path string
}
DirInvalidError is returned when the path specified as the config dir was not a directory.
func (*DirInvalidError) Error ¶
func (e *DirInvalidError) Error() string
type InvalidVarError ¶
type InvalidVarError struct {
Var string
}
InvalidVarError is used to inform the user that they variable they attempted to set / get doesn't exist
func (InvalidVarError) Error ¶
func (e InvalidVarError) Error() string
type Manager ¶
type Manager interface { Get(string) (string, error) GetIgnoreErr(string) string GetBool(string) (bool, error) GetV(string) (Var, error) GetSessionValidity() (int, error) GetVirtualMachine() lib.VirtualMachineName GetGroup() lib.GroupName GetAll() (Vars, error) Set(string, string, string) SetPersistent(varname string, value string, source string) error Unset(string) error GetDebugLevel() int EndpointName() string PanelURL() string ConfigDir() string ImportFlags(*flag.FlagSet) []string }
Manager is an interface defining a key->value store that also knows where the values were set from.
type Var ¶
Var is a struct which contains a name-value-source triplet Source is up to two words separated by a space. The first word is the source type: FLAG, ENV, DIR, CODE. The second is the name of the flag/file/environment var used.
func (Var) DefaultFields ¶
DefaultFields returns the list of default fields to feed to github.com/BytemarkHosting/row.From for this type.
func (Var) PrettyPrint ¶
func (v Var) PrettyPrint(wr io.Writer, detail prettyprint.DetailLevel) error
PrettyPrint outputs a nice human-readable overview of the server to the given writer.
func (*Var) SourceBaseName ¶
SourceBaseName returns the basename of the configVar's source. it's a bit stupid and so its output is only valid for configVars with SourceType() of DIR
func (*Var) SourceType ¶
SourceType returns one of the following: INTERACTION for a configVar set by some interaction with the user FLAG for a configVar whose value was set by passing a flag on the command line ENV for a configVar whose value was set from an environment variable DIR for a configVar whose value was set from a file in the config dir CODE for the default hardcoded into bytemark-client
func (*Var) SourceTypeAtLeast ¶
SourceTypeAtLeast ensures that this Var's SourceType is at least as 'good' as the one specified. The ranking is currently INTERACTION > FLAG > ENV > DIR > FLAG
type Vars ¶
type Vars []Var
Vars is a list of configuration variables
func (Vars) DefaultFields ¶
DefaultFields returns the list of default fields to feed to github.com/BytemarkHosting/row.From for this type, which is the same as VirtualMachine.DefaultFields.
func (Vars) PrettyPrint ¶
func (vs Vars) PrettyPrint(wr io.Writer, detail prettyprint.DetailLevel) error
PrettyPrint writes a human-readable summary of the virtual machines to writer at the given detail level.
type WriteError ¶
WriteError is returned when a file containing a value for a Var couldn't be written to.
func (*WriteError) Error ¶
func (e *WriteError) Error() string