Documentation
¶
Index ¶
- Constants
- func Add(name string, value string, usage string, required bool, options ...Options)
- func AddBool(name string, value bool, usage string, required bool, options ...Options)
- func AddDatabase(name string, value database.Database, usage string, required bool, ...)
- func AddFloat64(name string, value float64, usage string, required bool, options ...Options)
- func AddInt(name string, value int, usage string, required bool, options ...Options)
- func AddInt64(name string, value int64, usage string, required bool, options ...Options)
- func AddString(name string, value string, usage string, required bool, options ...Options)
- func AddUint(name string, value uint, usage string, required bool, options ...Options)
- func AddUint64(name string, value uint64, usage string, required bool, options ...Options)
- func GetCollection() map[string]Parameter
- func Parsed() bool
- type Options
- type Parameter
- type Results
- func (r Results) GetBool(key string) bool
- func (r Results) GetBoolSafe(key string) (bool, error)
- func (r Results) GetDatabase(key string) database.Database
- func (r Results) GetDatabaseSafe(key string) (database.Database, error)
- func (r Results) GetFloat64(key string) float64
- func (r Results) GetFloat64Safe(key string) (float64, error)
- func (r Results) GetInt(key string) int
- func (r Results) GetInt64(key string) int64
- func (r Results) GetInt64Safe(key string) (int64, error)
- func (r Results) GetIntSafe(key string) (int, error)
- func (r Results) GetString(key string) string
- func (r Results) GetStringSafe(key string) (string, error)
- func (r Results) GetUint(key string) uint
- func (r Results) GetUint64(key string) uint64
- func (r Results) GetUint64Safe(key string) (uint64, error)
- func (r Results) GetUintSafe(key string) (uint, error)
Constants ¶
const AwsRegionSecrets = "AWS-REGION-SECRETS"
AwsRegionSecrets is the constant name of AwsRegionSecrets flag or env variable
const StageParameter = "STAGE"
StageParameter is the constant name of stage flag or env variable
Variables ¶
This section is empty.
Functions ¶
func AddBool ¶
AddBool defines a bool Parameter with specified name, default value, and usage string.
func AddDatabase ¶
func AddDatabase(name string, value database.Database, usage string, required bool, options ...Options)
AddDatabase defines a database Parameter with specified name, default value, and usage string.
func AddFloat64 ¶
AddFloat64 defines a float64 Parameter with specified name, default value, and usage string.
func AddInt64 ¶
AddInt64 defines a int64 Parameter with specified name, default value, and usage string.
func AddString ¶
AddString defines a string Parameter with specified name, default value, and usage string.
func AddUint ¶
AddUint defines a uint Parameter with specified name, default value, and usage string.
func AddUint64 ¶
AddUint64 defines a uint64 Parameter with specified name, default value, and usage string.
func GetCollection ¶
GetCollection returns a collection of parameters.
Types ¶
type Options ¶
Options is a struct defines an options for parameters package SecretsManagerEnable - search a parameter in AWS Secrets Manager StageSensitive - the parameter a stage sensitive e.g: NAME_STAGE, where STAGE is a value of STAGE parameter
type Parameter ¶
type Parameter struct { Name string DefaultValue interface{} Usage string Required bool Options Options // contains filtered or unexported fields }
Parameter is a struct defines a Parameter
type Results ¶ added in v1.4.0
type Results map[string]interface{}
Results is a structure for parsed parameters.
func GetResults ¶ added in v1.4.0
func GetResults() Results
GetResults returns a result that already has been parsed.
func (Results) GetBool ¶ added in v1.4.0
GetBool returns a bool value from the results structure by key.
func (Results) GetBoolSafe ¶ added in v1.4.0
GetBoolSafe returns a bool value from the results structure by key. Returns an error if the type of value is different than bool.
func (Results) GetDatabase ¶ added in v1.4.0
GetDatabase returns a database value from the results structure by key.
func (Results) GetDatabaseSafe ¶ added in v1.4.0
GetDatabaseSafe returns a database value from the results structure by key. Returns an error if the type of value is different than database.
func (Results) GetFloat64 ¶ added in v1.4.0
GetFloat64 returns a float64 value from the results structure by key.
func (Results) GetFloat64Safe ¶ added in v1.4.0
GetFloat64Safe returns a float64 value from the results structure by key. Returns an error if the type of value is different than float64.
func (Results) GetInt ¶ added in v1.4.0
GetInt returns an int value from the results structure by key.
func (Results) GetInt64 ¶ added in v1.4.0
GetInt64 returns an int64 value from the results structure by key.
func (Results) GetInt64Safe ¶ added in v1.4.0
GetInt64Safe returns an int64 value from the results structure by key. Returns an error if the type of value is different than int64.
func (Results) GetIntSafe ¶ added in v1.4.0
GetIntSafe returns an int value from the results structure by key. Returns an error if the type of value is different than int.
func (Results) GetString ¶ added in v1.4.0
GetString returns a string value from the results structure by key.
func (Results) GetStringSafe ¶ added in v1.4.0
GetStringSafe returns a string value from the results structure by key. Returns an error if the type of value is different than string.
func (Results) GetUint ¶ added in v1.4.0
GetUint returns an uint value from the results structure by key.
func (Results) GetUint64 ¶ added in v1.4.0
GetUint64 returns an uint64 value from the results structure by key.
func (Results) GetUint64Safe ¶ added in v1.4.0
GetUint64Safe returns an uint64 value from the results structure by key. Returns an error if the type of value is different than uint64.