ini

package
v0.0.0-...-8f6bda2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CFG_BOOL = iota
	CFG_FLOAT64
	CFG_INT
	CFG_INT64
	CFG_STRING
)

获取值类型

Variables

This section is empty.

Functions

This section is empty.

Types

type Cfg

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

func LoadConfigFile

func LoadConfigFile(file string, sep string) (Cfg, error)

加载配置文件

func (Cfg) Get

func (c Cfg) Get(key string) interface{}

根据键名获取值[返回string][失败返回nil]

func (Cfg) GetBool

func (c Cfg) GetBool(key string) interface{}

根据键名获取值[返回bool][失败返回nil]

func (Cfg) GetBoolMust

func (c Cfg) GetBoolMust(key string, def bool) bool

根据键名获取值[必须]

func (Cfg) GetFloat64

func (c Cfg) GetFloat64(key string) interface{}

根据键名获取值[返回float64][失败返回nil]

func (Cfg) GetFloat64Must

func (c Cfg) GetFloat64Must(key string, def float64) float64

根据键名获取值[必须]

func (Cfg) GetInt

func (c Cfg) GetInt(key string) interface{}

根据键名获取值[返回int][失败返回nil]

func (Cfg) GetInt64

func (c Cfg) GetInt64(key string) interface{}

根据键名获取值[返回int64][失败返回nil]

func (Cfg) GetInt64Must

func (c Cfg) GetInt64Must(key string, def int64) int64

根据键名获取值[必须]

func (Cfg) GetIntMust

func (c Cfg) GetIntMust(key string, def int) int

根据键名获取值[必须]

func (Cfg) GetMust

func (c Cfg) GetMust(key string, def string) string

根据键名获取值[必须]

func (Cfg) GetValue

func (c Cfg) GetValue(key string, flag int, def interface{}) interface{}

获取配置值

Jump to

Keyboard shortcuts

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