config

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2018 License: GPL-3.0 Imports: 6 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Errunsupported = fmt.Errorf("expect ptr data")
	ErrInvalidType = fmt.Errorf("result must be ptr")
	ErrNotFound    = fmt.Errorf("key not found")
)

Functions

func LoadConfig

func LoadConfig(path string, result interface{}) error

Types

type Config

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

Config 读ini配置文件.

func NewConfig

func NewConfig(path string) (c *Config, err error)

NewConfig 加载配置文件.

func (*Config) GetData

func (c *Config) GetData(s, k string, result interface{}, d interface{}) error

GetData 获取指定段的指定key的值, 支持int,string.

Jump to

Keyboard shortcuts

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