Documentation
¶
Index ¶
- func All() map[string]any
- func Args() []string
- func ConfigName() string
- func Expand(s string) string
- func ForEach(path string, fn func(c *Config) error) error
- func GetBool(path string) bool
- func GetDuration(path string) time.Duration
- func GetFloat64(path string) float64
- func GetFloat64Slice(path string) []float64
- func GetInt(path string) int
- func GetInt64(path string) int64
- func GetInt64Slice(path string) []int64
- func GetIntSlice(path string) []int
- func GetInterface(path string) any
- func GetString(path string) string
- func GetStringMap(path string) map[string]string
- func GetStringSlice(path string) []string
- func GetTime(path string) time.Time
- func GetUint(path string) uint
- func GetUint64(path string) uint64
- func GetUint64Slice(path string) []uint64
- func GetUintSlice(path string) []uint
- func Has(path string) bool
- func MustReadConfigFile() error
- func ParseTime(v string) (time.Time, error)
- func ReadConfig(buf []byte) error
- func ReadConfigFile() error
- func Unmarshal(path string, val any) error
- type Config
- func (c *Config) All() map[string]any
- func (c *Config) Args() []string
- func (c *Config) Branch(path string) (*Config, error)
- func (c *Config) ConfigName() string
- func (c *Config) EnvPrefix() string
- func (c *Config) Expand(s string) string
- func (c *Config) ForEach(path string, fn func(c *Config) error) error
- func (c *Config) GetBool(path string) bool
- func (c *Config) GetDuration(path string) time.Duration
- func (c *Config) GetFloat64(path string) float64
- func (c *Config) GetFloat64Slice(path string) []float64
- func (c *Config) GetInt(path string) int
- func (c *Config) GetInt64(path string) int64
- func (c *Config) GetInt64Slice(path string) []int64
- func (c *Config) GetIntSlice(path string) []int
- func (c *Config) GetInterface(path string) any
- func (c *Config) GetString(path string) string
- func (c *Config) GetStringMap(path string) map[string]string
- func (c *Config) GetStringSlice(path string) []string
- func (c *Config) GetTime(path string) time.Time
- func (c *Config) GetUint(path string) uint
- func (c *Config) GetUint64(path string) uint64
- func (c *Config) GetUint64Slice(path string) []uint64
- func (c *Config) GetUintSlice(path string) []uint
- func (c *Config) Has(path string) bool
- func (c *Config) MustReadConfigFile() error
- func (c *Config) ReadConfig(buf []byte) error
- func (c *Config) ReadConfigFile(failNonExist ...bool) error
- func (c *Config) Set(key string, val any) *Config
- func (c *Config) SetConfigName(name string) *Config
- func (c *Config) SetDefault(key string, val any) *Config
- func (c *Config) SetEnvPrefix(p string) *Config
- func (c *Config) Unmarshal(path string, val any) error
- func (c *Config) Use(val map[string]any) *Config
- func (c *Config) UseEnv(enabled bool) *Config
- type Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigName ¶
func ConfigName() string
func GetDuration ¶
func GetFloat64 ¶
func GetFloat64Slice ¶
func GetInt64Slice ¶
func GetIntSlice ¶
func GetInterface ¶
func GetStringMap ¶
func GetStringSlice ¶
func GetUint64Slice ¶
func GetUintSlice ¶
func MustReadConfigFile ¶
func MustReadConfigFile() error
func ReadConfig ¶
func ReadConfigFile ¶
func ReadConfigFile() error
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func SetConfigName ¶
func SetDefault ¶
func SetEnvPrefix ¶
func (*Config) ConfigName ¶
func (*Config) GetFloat64 ¶
func (*Config) GetFloat64Slice ¶
func (*Config) GetInt64Slice ¶
func (*Config) GetIntSlice ¶
func (*Config) GetInterface ¶
func (*Config) GetStringSlice ¶
func (*Config) GetUint64Slice ¶
func (*Config) GetUintSlice ¶
func (*Config) MustReadConfigFile ¶
func (*Config) ReadConfig ¶
func (*Config) ReadConfigFile ¶
func (*Config) SetConfigName ¶
func (*Config) SetEnvPrefix ¶
Click to show internal directories.
Click to hide internal directories.