config

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DevMode  = "dev"
	TestMode = "test"
	ProdMode = "prod"
)

Variables

This section is empty.

Functions

func DefaultBool

func DefaultBool(key string, def bool) bool

DefaultBool DefaultBool

func DefaultFloat

func DefaultFloat(key string, def float64) float64

DefaultInt DefaultInt

func DefaultInt

func DefaultInt(key string, def int) int

DefaultInt get default int

config.DefaultInt("prov_id",1)

func DefaultInt64

func DefaultInt64(key string, def int64) int64

DefaultInt DefaultInt

func DefaultString

func DefaultString(key, def string) string

DefaultString get default string

config.DefaultString("prov","四川")

func GetBool

func GetBool(key string) (bool, error)

GetInt64

func GetFloat

func GetFloat(key string) (float64, error)

func GetInt

func GetInt(key string) (int, error)

GetInt get int

config.GetInt("prov_id)

func GetInt64

func GetInt64(key string) (int64, error)

func GetString

func GetString(key string) string

GetString get string

config.GetString("prov")

func InitLoad

func InitLoad(fileName string)

InitLoad 读取指定的配置文件

config.InitLoad("conf/my.ini")
config.GetString("key")

func Keys

func Keys(section string) []string

Keys 获取section下的所有keys

Types

This section is empty.

Jump to

Keyboard shortcuts

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