Documentation
¶
Index ¶
- func BuildDevEnv(c *Env, secrets *Secrets, skipFields ...string) error
- func BuildPrompt(text string) string
- func Get(t EnvType, c *Env) error
- func LoadConfig(c *Env) error
- func RemoveKey(service, key string) error
- func SensitiveInputPrompt(p *Prompter) (string, error)
- func UpdateKey(service, key, value string) error
- type ConfigType
- type Env
- type EnvType
- type PasswordReader
- type Prompter
- type Secret
- type Secrets
- type StdInPasswordReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildDevEnv ¶
BuildDevEnv fills the values of the struct with the values from the keychain.
func BuildPrompt ¶
func LoadConfig ¶
LoadConfig loads the config from the file or falls back to environmental variables.
func SensitiveInputPrompt ¶
Types ¶
type ConfigType ¶
type ConfigType string
const ( JSON ConfigType = "json" YAML ConfigType = "yaml" )
var (
CUSTOM ConfigType = "" // This will search for whatever custom tag you specify
)
type Env ¶
type Env struct { Name string // Name of the config file Debug bool // Print debug messages Type ConfigType // Type of the config file ("json" or "yaml") Path string // Path to the config file EnvPrefix string // Prefix for environment variable names ConfigStruct interface{} // Struct to store the config values SkipFields []string // Fields to skip when loading from env }
Config holds the configuration parameters for retrieving a config.
type PasswordReader ¶
PasswordReader returns password read from a reader
type Secrets ¶
type Secrets []Secret
type StdInPasswordReader ¶
type StdInPasswordReader struct{}
StdInPasswordReader default stdin password reader
func (StdInPasswordReader) ReadPassword ¶
func (pr StdInPasswordReader) ReadPassword() (string, error)
ReadPassword reads password from stdin
Click to show internal directories.
Click to hide internal directories.