Categorygithub.com/powerman/appcfg
modulepackage
0.9.0
Repository: https://github.com/powerman/appcfg.git
Documentation: pkg.go.dev

# README

Get valid application configuration from flags/env/config files/consul/… for Go

Go Reference CI/CD Coverage Status Go Report Card Release

# Packages

No description provided by the author

# Functions

AddFlag defines a flag with the specified name and usage string.
AddPFlag defines a flag with the specified name and usage string.
FromEnvTrimSpace removes from environment variables value all leading and trailing white space, as defined by Unicode.
MustBool returns Bool initialized with given value or panics.
MustBoolSlice returns BoolSlice initialized with given values or panics.
MustDuration returns Duration initialized with given value or panics.
MustDurationSlice returns DurationSlice initialized with given values or panics.
MustEndpoint returns Endpoint initialized with given value or panics.
MustEndpointSlice returns EndpointSlice initialized with given values or panics.
MustFloat64 returns Float64 initialized with given value or panics.
MustFloat64Slice returns Float64Slice initialized with given values or panics.
MustHostPort returns HostPort initialized with given value or panics.
MustHostPortSlice returns HostPortSlice initialized with given values or panics.
MustInt returns Int initialized with given value or panics.
MustInt64 returns Int64 initialized with given value or panics.
MustInt64Slice returns Int64Slice initialized with given values or panics.
MustIntBetween returns IntBetween initialized with given value or panics.
MustIntBetweenSlice returns IntBetweenSlice initialized with given value or panics.
MustIntSlice returns IntSlice initialized with given values or panics.
MustIPNet returns IPNet initialized with given value or panics.
MustIPNetSlice returns IPNetSlice initialized with given values or panics.
MustListenPort returns ListenPort initialized with given value or panics.
MustListenPortSlice returns ListenPortSlice initialized with given values or panics.
MustNotEmptyString returns NotEmptyString initialized with given value or panics.
MustNotEmptyStringArray returns NotEmptyStringArray initialized with given values or panics.
MustNotEmptyStringSlice returns NotEmptyStringSlice initialized with given values or panics.
MustOneOfString returns OneOfString initialized with given value or panics.
MustOneOfStringSlice returns OneOfStringSlice initialized with given value or panics.
MustPort returns Port initialized with given value or panics.
MustPortSlice returns PortSlice initialized with given values or panics.
MustString returns String initialized with given value or panics.
MustStringArray returns StringArray initialized with given values or panics.
MustStringSlice returns StringSlice initialized with given values or panics.
MustUint returns Uint initialized with given value or panics.
MustUint64 returns Uint64 initialized with given value or panics.
MustUint64Slice returns Uint64Slice initialized with given values or panics.
MustUintSlice returns UintSlice initialized with given values or panics.
NewFromEnv creates new FromEnv with optional prefix.
NewIntBetween returns IntBetween without value set.
NewIntBetweenSlice returns IntBetweenSlice without value set.
NewOneOfString returns OneOfString without value set.
NewOneOfStringSlice returns OneOfStringSlice without value set.
ProvideStruct updates cfg using values from given providers.
WrapErr adds more details about err.Value (if err is a RequiredError) by looking for related flag name and field name/tags in given fs and cfgs, otherwise returns err as is.
WrapPErr adds more details about err.Value (if err is a RequiredError) by looking for related flag name and field name/tags in given fs and cfgs, otherwise returns err as is.

# Structs

Bool can be set to 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
BoolSlice can be set to comma-separated strings 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
Duration can be set only to string valid for time.ParseDuration().
DurationSlice can be set to comma-separated strings valid for time.ParseDuration().
Endpoint can be set only to valid url with hostname.
EndpointSlice can be set to valid urls with hostname.
Float64 can be set to 64-bit floating-point number.
Float64Slice can be set to comma-separated 64-bit floating-point numbers.
FromEnv implements Provider using value from environment variable with name defined by tag "env" with optional prefix.
HostPort can be set to CIDR address.
HostPortSlice can be set to comma-separated CIDR addresses.
No description provided by the author
Int can be set to integer value.
Int64 can be set to 64-bit integer value.
Int64Slice can be set to comma-separated 64-bit integer values.
IntBetween can be set to integer value between given (using NewIntBetween or MustIntBetween) min/max values (inclusive).
IntBetweenSlice can be set to comma-separated integer values between given (using NewIntBetween or MustIntBetween) min/max values (inclusive).
IntSlice can be set to comma-separated integer values.
IPNet can be set to CIDR address.
IPNetSlice can be set to comma-separated CIDR address.
ListenPort can be set to integer value between 0 and 65535.
ListenPortSlice can be set to comma-separated integer values between 0 and 65535.
NotEmptyString can be set to any string which contains at least one non-whitespace symbol.
NotEmptyStringArray can be set to any strings which contains at least one non-whitespace symbol.
NotEmptyStringSlice can be set to any comma-separated strings which contains at least one non-whitespace symbol.
OneOfString can be set to any of predefined (using NewOneOfString or MustOneOfString) values.
OneOfStringSlice can be set to predefined (using NewOneOfString or MustOneOfString) comma-separated strings.
Port can be set to integer value between 1 and 65535.
PortSlice can be set to comma-separated integer values between 1 and 65535.
RequiredError is returned from Value(&err) methods if value wasn't set.
String can be set to any string, even empty.
StringArray can be set to any strings, even empty.
StringSlice can be set to any comma-separated strings, even empty.
Uint can be set to unsigned integer value.
Uint64 can be set to unsigned 64-bit integer value.
Uint64Slice can be set to comma-separated unsigned 64-bit integer values.
UintSlice can be set to comma-separated unsigned integer values.

# Interfaces

Provider tries to find and set value based on it name and/or tags.
Tags provide access to tags attached to some Value.
Value provides a way to set value of any type from (one or several) string with validation.

# Type aliases

FromEnvOption is an option for NewFromEnv.