Documentation
¶
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func StrOrFile ¶
StrOrFile attempts to identify a valid file path from value; if value starts with "/" or "./" it will attempt to read the file contents and return it instead; if the file contains an extra \n it will be trimmed. If no file is found (either value does not start with "/" or "./", or file does not exist), value is returned.
func StrOrFileIfExists ¶ added in v0.8.7
StrOrFileIfExists reads and returns the contents of value if it points to an existing regular file. If value is not an existing file, the original string is returned unchanged.
Types ¶
type ConfigProvider ¶ added in v0.6.0
type ConfigProvider interface {
Get(dest interface{}) error
GetKey(key string, dest interface{}) error
GetStringKey(key string) (string, error)
GetBoolKey(key string) (bool, error)
GetIntKey(key string) (int, error)
GetFloat64Key(key string) (float64, error)
GetSliceKey(key, separator string) ([]string, error)
GetConfigNode(key string) (ConfigProvider, error)
KeyExists(key string) bool
KeyListExists(keys []string) bool
}
Click to show internal directories.
Click to hide internal directories.