config

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 8, 2021 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCast = errors.New("unable to cast")

Functions

func AddConfigPath

func AddConfigPath(p string)

func BoolOrDefault

func BoolOrDefault(key string, defVal bool) bool

func Get

func Get(key string) interface{}

func GetBool

func GetBool(key string) bool

func GetInt

func GetInt(key string) int

func GetInt64

func GetInt64(key string) int64

func GetString

func GetString(key string) string

func Int32OrDefault

func Int32OrDefault(key string, defVal int32) int32

func Int64OrDefault

func Int64OrDefault(key string, defVal int64) int64

func IntOrDefault

func IntOrDefault(key string, defVal int) int

func Milliseconds

func Milliseconds(key string) time.Duration

func MillisecondsOrDefault

func MillisecondsOrDefault(key string, defVal time.Duration) time.Duration

func Minutes

func Minutes(key string) time.Duration

func MinutesOrDefault

func MinutesOrDefault(key string, defVal time.Duration) time.Duration

func ReadConfig

func ReadConfig(r io.Reader) error

func ReadConfigFile

func ReadConfigFile() error

func Seconds

func Seconds(key string) time.Duration

func SecondsOrDefault

func SecondsOrDefault(key string, defVal time.Duration) time.Duration

func Set

func Set(key string, value interface{})

func SetConfigFile

func SetConfigFile(p string)

func SetEnvKeyReplacer

func SetEnvKeyReplacer(r *strings.Replacer)

func SetEnvPrefix

func SetEnvPrefix(p string)

func StringOrDefault

func StringOrDefault(key, defVal string) string

Types

type FileNotFoundError

type FileNotFoundError struct {
	// contains filtered or unexported fields
}

func (FileNotFoundError) Error

func (f FileNotFoundError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL