Documentation
¶
Index ¶
- func EncodeOSEnv(key, val string) string
- func EncodeOSEnvFunc(key, val string, fn callback) string
- func FlagOrEnv(cmd *cobra.Command, flagName string, envName string, defaultValue string) string
- func NewLogger(cmd *cobra.Command) logger.Logger
- func WriteEnvFile(fn string, envs []EnvLine) error
- type EnvLine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeOSEnv ¶ added in v1.0.2
EncodeOSEnv encodes an environment variable for use in an OS environment.
func EncodeOSEnvFunc ¶ added in v1.0.2
EncodeOSEnvFunc encodes an environment variable for use in an OS environment using a custom sprintf function.
func FlagOrEnv ¶
FlagOrEnv will try and get a flag from the cobra.Command and if not found, look it up in the environment and fallback to defaultValue if non found
func NewLogger ¶
NewLogger returns a console logger by first checking the cobra.Command log-level flag, then use the AGENTUITY_LOG_LEVEL environment value and falling back to the info logger level
func WriteEnvFile ¶ added in v1.0.2
WriteEnvFile writes an environment file to a file.
Types ¶
type EnvLine ¶ added in v1.0.2
func ParseEnvBuffer ¶ added in v1.0.2
ParseEnvBuffer parses an environment file from a buffer and returns a list of EnvLine structs.
func ParseEnvFile ¶ added in v1.0.2
ParseEnvFile parses an environment file and returns a list of EnvLine structs.
func ParseEnvValue ¶ added in v1.0.2
func ProcessEnvLine ¶ added in v1.0.2
ProcessEnvLine processes an environment variable line and returns an EnvLine struct with the key, value, and secret flag set.