config

package
v0.0.0-...-2d67580 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2018 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckKeyIsExists

func CheckKeyIsExists(key string) bool

func GetBoolOrDefault

func GetBoolOrDefault(key string, or bool) bool

func GetInt64OrDefault

func GetInt64OrDefault(key string, or int64) int64

func GetIntOrDefault

func GetIntOrDefault(key string, or int) int

func GetStringOrDefault

func GetStringOrDefault(key, or string) string

func GetStringSliceOrDefault

func GetStringSliceOrDefault(key string, or []string) []string

func LoadConfig

func LoadConfig(options ...Option) (err error)

this function will search and load configurations

func SetConfig

func SetConfig(key string, value interface{}) error

Types

type Option

type Option struct {
	Project                  string
	Path                     string
	FileMustExists           bool
	DefaultPath              string
	DefaultConfigureName     string
	ConfigSearchPath         string
	ConfigSearchPaths        []string
	ConfigFallbackSearchPath string
}

func (*Option) GetDefaultPath

func (c *Option) GetDefaultPath() string

func (*Option) With

func (c *Option) With(rhs *Option) *Option

Jump to

Keyboard shortcuts

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