Documentation ¶
Index ¶
- func CommandBundle(appName string, global bool, merged bool) error
- func CommandClear(appName string, global bool, noRestart bool) error
- func CommandExport(appName string, global bool, merged bool, format string) error
- func CommandGet(appName string, keys []string, global bool, quoted bool) error
- func CommandKeys(appName string, global bool, merged bool) error
- func CommandSet(appName string, pairs []string, global bool, noRestart bool, encoded bool) error
- func CommandShow(appName string, global bool, merged bool, shell bool, export bool) error
- func CommandUnset(appName string, keys []string, global bool, noRestart bool) error
- func Get(appName string, key string) (value string, ok bool)
- func GetWithDefault(appName string, key string, defaultValue string) (value string)
- func SetMany(appName string, entries map[string]string, restart bool) (err error)
- func SubBundle(appName string, merged bool) error
- func SubClear(appName string, noRestart bool) error
- func SubExport(appName string, merged bool, format string) error
- func SubGet(appName string, keys []string, quoted bool) error
- func SubKeys(appName string, merged bool) error
- func SubSet(appName string, pairs []string, noRestart bool, encoded bool) error
- func SubShow(appName string, merged bool, shell bool, export bool) error
- func SubUnset(appName string, keys []string, noRestart bool) error
- func TriggerConfigExport(appName string, global string, merged string, format string) error
- func TriggerConfigGet(appName string, key string) error
- func TriggerConfigGetGlobal(key string) error
- func TriggerPostAppCloneSetup(oldAppName string, newAppName string) error
- func TriggerPostAppRenameSetup(oldAppName string, newAppName string) error
- func UnsetAll(appName string, restart bool) (err error)
- func UnsetMany(appName string, keys []string, restart bool) (err error)
- type Env
- func (e *Env) DockerArgsKeysString() string
- func (e *Env) DockerArgsString() string
- func (e *Env) EnvfileString() string
- func (e *Env) Export(format ExportFormat) string
- func (e *Env) ExportBundle(dest io.Writer) error
- func (e *Env) ExportfileString() string
- func (e *Env) Filename() string
- func (e *Env) Get(key string) (value string, ok bool)
- func (e *Env) GetBoolDefault(key string, defaultValue bool) bool
- func (e *Env) GetDefault(key string, defaultValue string) string
- func (e *Env) JSONListString() string
- func (e *Env) JSONString() string
- func (e *Env) Keys() (keys []string)
- func (e *Env) Len() int
- func (e *Env) Map() map[string]string
- func (e *Env) Merge(other *Env)
- func (e *Env) PackArgKeysAsString() string
- func (e *Env) Set(key string, value string)
- func (e *Env) ShellString() string
- func (e *Env) String() string
- func (e *Env) Unset(key string)
- func (e *Env) Write() error
- type ExportFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandBundle ¶
CommandBundle creates a tarball of a .env.d directory containing env vars for the app
func CommandClear ¶
CommandClear unsets all environment variables in use
func CommandExport ¶
CommandExport outputs all env vars (merged or not, global or not) in the specified format for consumption by other tools
func CommandGet ¶
CommandGet gets the value for the specified environment variable
func CommandKeys ¶
CommandKeys shows the keys set for the specified environment
func CommandSet ¶
CommandSet sets one or more environment variable pairs
func CommandShow ¶
CommandShow pretty-prints the specified environment vaiables
func CommandUnset ¶
CommandUnset unsets one or more keys in a specified environment
func GetWithDefault ¶
GetWithDefault gets a value from a config. If appName is empty the global config is used. If the appName or key do not exist defaultValue is returned.
func SetMany ¶
SetMany variables in the environment. If appName is empty the global config is used. If restart is true the app is restarted.
func TriggerConfigExport ¶
TriggerConfigExport returns a global config value by key
func TriggerConfigGet ¶
TriggerConfigGet returns an app config value by key
func TriggerConfigGetGlobal ¶
TriggerConfigGetGlobal returns a global config value by key
func TriggerPostAppCloneSetup ¶
TriggerPostAppCloneSetup creates new buildpacks files
func TriggerPostAppRenameSetup ¶
TriggerPostAppRenameSetup renames buildpacks files
Types ¶
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env is a representation for global or app environment
func LoadAppEnv ¶
LoadAppEnv loads an environment for the given app
func LoadMergedAppEnv ¶
LoadMergedAppEnv loads an app environment merged with the global environment
func (*Env) DockerArgsKeysString ¶
DockerArgsKeysString gets the contents of this Env in the form -env=KEY --env...
func (*Env) DockerArgsString ¶
DockerArgsString gets the contents of this Env in the form -env=KEY=VALUE --env...
func (*Env) EnvfileString ¶
EnvfileString returns the contents of this Env in dotenv format
func (*Env) Export ¶
func (e *Env) Export(format ExportFormat) string
Export the Env in the given format
func (*Env) ExportBundle ¶
ExportBundle writes a tarfile of the environment to the given io.Writer. for every environment variable there is a file with the variable's key with its content set to the variable's value
func (*Env) ExportfileString ¶
ExportfileString returns the contents of this Env as bash exports
func (*Env) GetBoolDefault ¶
GetBoolDefault gets the bool value of the given key with the given default right now that is evaluated as `value != "0"`
func (*Env) GetDefault ¶
GetDefault an environment variable or a default if it doesn't exist
func (*Env) JSONListString ¶
JSONListString returns the contents of this Env as a json list of objects containing the name and the value of the env var
func (*Env) JSONString ¶
JSONString returns the contents of this Env as a key/value json object
func (*Env) PackArgKeysAsString ¶
PackArgKeysAsString gets the contents of this Env in the form -env KEY --env...
func (*Env) ShellString ¶
ShellString gets the contents of this Env in the form "KEY='value' KEY2='value'" for passing the environment in the shell
type ExportFormat ¶
type ExportFormat int
ExportFormat types of possible exports
const ( //ExportFormatExports format: Sourceable exports ExportFormatExports ExportFormat = iota //ExportFormatEnvfile format: dotenv file ExportFormatEnvfile //ExportFormatDockerArgs format: --env KEY=VALUE args for docker ExportFormatDockerArgs //ExportFormatDockerArgsKeys format: --env=KEY args for docker ExportFormatDockerArgsKeys //ExportFormatShell format: env arguments for shell ExportFormatShell //ExportFormatPretty format: pretty-printed in columns ExportFormatPretty //ExportFormatJSON format: json key/value output ExportFormatJSON //ExportFormatJSONList format: json output as a list of objects ExportFormatJSONList //ExportFormatPackArgKeys format: --env KEY args for pack ExportFormatPackArgKeys )