Versions in this module Expand all Collapse all v1 v1.0.1 Jul 23, 2019 v1.0.0 May 31, 2019 Changes in this version + const DateFormat + const DateTimeFormat + const TimeFormat + var KeyNotFoundError = errors.New("The specified key was not found.") + var MalformedValueError = errors.New("The specified value could not be parsed.") + func Hostname() string + type CLI func(*CLISource) + func BoolFlag(name, description string) CLI + func ContinueOnError() CLI + func Flag(name, description string) CLI + func PanicOnError() CLI + func SetOutput(writer io.Writer) CLI + func Usage(message string) CLI + type CLIConfigFileSource struct + func FromCLIConfigFileSource(flagName string) *CLIConfigFileSource + func FromDefaultCLIConfigFileSource() *CLIConfigFileSource + func (this *CLIConfigFileSource) Initialize() + func (this *CLIConfigFileSource) Strings(key string) ([]string, error) + type CLISource struct + func FromCLI(options ...CLI) *CLISource + func (this *CLISource) Initialize() + func (this *CLISource) Strings(key string) ([]string, error) + type Client interface + Do func(*http.Request) (*http.Response, error) + type ConditionalSource struct + func FromDevelopmentOnlyDefaults(pairs ...DefaultPair) *ConditionalSource + func NewConditionalSource(condition func() bool, pairs ...DefaultPair) *ConditionalSource + func (this *ConditionalSource) Initialize() + func (this *ConditionalSource) Strings(key string) ([]string, error) + type DefaultPair func(*DefaultSource) + func Default(key string, values ...interface{}) DefaultPair + type DefaultSource struct + func NewDefaultSource(pairs ...DefaultPair) *DefaultSource + func (this *DefaultSource) Initialize() + func (this *DefaultSource) Strings(key string) ([]string, error) + type DirectorySource struct + func FromDirectory(path string) *DirectorySource + func FromOptionalDirectory(path string) *DirectorySource + func (this *DirectorySource) Initialize() + func (this *DirectorySource) Strings(key string) ([]string, error) + type EnvironmentSource struct + func FromEnvironment() *EnvironmentSource + func FromEnvironmentCustomSeparator(prefix, separator string) *EnvironmentSource + func FromEnvironmentWithPrefix(prefix string) *EnvironmentSource + func (this *EnvironmentSource) Initialize() + func (this *EnvironmentSource) Strings(key string) ([]string, error) + type JSONSource struct + func FromConditionalJSONFile(filename string, condition func() bool) *JSONSource + func FromConfigurableJSONFile() *JSONSource + func FromJSONContent(raw []byte) *JSONSource + func FromJSONFile(filename string) *JSONSource + func FromJSONObject(values map[string]interface{}) *JSONSource + func FromOptionalJSONFile(filename string) *JSONSource + func FromTemplateJSON(item *Template) *JSONSource + func FromTemplateJSONFileWithSources(templatePath, confJson string, directories ...string) *JSONSource + func FromVaultDocument(token, address, documentName string) *JSONSource + func (this *JSONSource) Initialize() + func (this *JSONSource) Strings(key string) ([]string, error) + type MultiSource []Source + func FromOptionalDirectories(paths ...string) MultiSource + func (this MultiSource) Initialize() + func (this MultiSource) Strings(key string) (result []string, err error) + type Reader struct + func NewReader(sources ...Source) *Reader + func (this *Reader) Bool(key string) bool + func (this *Reader) BoolDefault(key string, Default bool) bool + func (this *Reader) BoolError(key string) (bool, error) + func (this *Reader) BoolFatal(key string) bool + func (this *Reader) BoolPanic(key string) bool + func (this *Reader) Duration(key string) time.Duration + func (this *Reader) DurationDefault(key string, Default time.Duration) time.Duration + func (this *Reader) DurationError(key string) (time.Duration, error) + func (this *Reader) DurationFatal(key string) time.Duration + func (this *Reader) DurationPanic(key string) time.Duration + func (this *Reader) Int(key string) int + func (this *Reader) IntDefault(key string, Default int) int + func (this *Reader) IntError(key string) (int, error) + func (this *Reader) IntFatal(key string) int + func (this *Reader) IntPanic(key string) int + func (this *Reader) Ints(key string) []int + func (this *Reader) IntsDefault(key string, Default []int) []int + func (this *Reader) IntsError(key string) ([]int, error) + func (this *Reader) IntsFatal(key string) []int + func (this *Reader) IntsPanic(key string) []int + func (this *Reader) RegisterAlias(key, alias string) + func (this *Reader) String(key string) string + func (this *Reader) StringDefault(key string, Default string) string + func (this *Reader) StringError(key string) (string, error) + func (this *Reader) StringFatal(key string) string + func (this *Reader) StringPanic(key string) string + func (this *Reader) Strings(key string) []string + func (this *Reader) StringsDefault(key string, Default []string) []string + func (this *Reader) StringsError(key string) ([]string, error) + func (this *Reader) StringsFatal(key string) []string + func (this *Reader) StringsPanic(key string) []string + func (this *Reader) Time(key string, format string) time.Time + func (this *Reader) TimeDefault(key string, format string, Default time.Time) time.Time + func (this *Reader) TimeError(key string, format string) (time.Time, error) + func (this *Reader) TimeFatal(key string, format string) time.Time + func (this *Reader) TimePanic(key string, format string) time.Time + func (this *Reader) URL(key string) url.URL + func (this *Reader) URLDefault(key string, Default url.URL) url.URL + func (this *Reader) URLError(key string) (url.URL, error) + func (this *Reader) URLFatal(key string) url.URL + func (this *Reader) URLPanic(key string) url.URL + func (this *Reader) URLs(key string) []url.URL + func (this *Reader) URLsDefault(key string, Default []url.URL) []url.URL + func (this *Reader) URLsError(key string) ([]url.URL, error) + func (this *Reader) URLsFatal(key string) []url.URL + func (this *Reader) URLsPanic(key string) []url.URL + type RetryClient struct + func NewRetryClient(inner Client, retries int, timeout time.Duration) *RetryClient + func (this *RetryClient) Do(request *http.Request) (response *http.Response, err error) + type Source interface + Initialize func() + Strings func(key string) ([]string, error) + func FirstOrNop(sources ...Source) Source + func FromRequiredInProductionJSONFile(filename string) Source + type Template struct + Content string + func NewTemplate(content string, sources ...Source) *Template + func (this *Template) Run() (ret []byte, err error) + func (this *Template) String() (ret string, err error) + type VaultSource struct Other modules containing this package github.com/smartystreets/configo/v2