Documentation ¶
Index ¶
Constants ¶
View Source
const ( B = 1 << (iota * 10) KB MB GB TB )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConfigFiles ¶
type ConfigFiles struct {
Files []File
}
ConfigFiles represents multiple file containing the config keys and values
func (*ConfigFiles) AddConfig ¶
func (c *ConfigFiles) AddConfig(path, name string, required bool)
AddConfig adds a config file
func (ConfigFiles) MergeConfigsInto ¶
func (c ConfigFiles) MergeConfigsInto(dest interface{}) (map[string]Default, error)
MergeConfigsInto merges multiple configs files into a struct returns the applied default values
type CustomType ¶
CustomType can be implemented to unmarshal in a custom format
type Default ¶
type Default struct { Value string // contains filtered or unexported fields }
Default represents a default value for a field
type FileSize ¶
type FileSize uint64
FileSize implements Unmarshal for parsing a file size config value. e.g. 10MB
func (FileSize) HumanReadable ¶ added in v1.0.4
HumanReadable returns a human readable form of the filesize e.g 12.5 MB, 1.0 GB
Click to show internal directories.
Click to hide internal directories.