config

package module
v0.0.0-...-324bb81 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

golang-config

配置

Documentation

Index

Constants

View Source
const (
	CFG_KEY_LOG         = "Log"
	CFG_KEY_LOG_LOGFILE = "LogFile"
	CFG_KEY_LOG_LEVEL   = "Level"
	CFG_KEY_LOG_EXPIRE  = "Expire"
	CFG_KEY_LOG_TRACE   = "Trace"
)
View Source
const (
	CFG_KEY_MYSQL             = "Mysql"
	CFG_KEY_MYSQL_ADDR        = "Addr"
	CFG_KEY_MYSQL_USERNAME    = "Username"
	CFG_KEY_MYSQL_PASSWORD    = "Password"
	CFG_KEY_MYSQL_DATABASE    = "Database"
	CFG_KEY_MYSQL_DSNOPTIONS  = "Dsnoptions"
	CFG_KEY_MYSQL_MAXIDEL     = "Maxidle"
	CFG_KEY_MYSQL_MAXOPEN     = "Maxopen"
	CFG_KEY_MYSQL_MAXLIFETIME = "Maxlifetime"
	CFG_KEY_MYSQL_SLOWTIME    = "Slowtime"
	CFG_KEY_MYSQL_SLOWLOGGER  = "Slowlogger"
)

Variables

View Source
var ErrSectionNotExists = errors.New("section not exists")
View Source
var Log map[string]*log.Conf
View Source
var Mysql map[string]*mysql.Conf

Functions

func GetKeyMust

func GetKeyMust(sec *ini.Section, node, key string) *ini.Key

func GetKeyParentMust

func GetKeyParentMust(sec, psec *ini.Section, node, key string) *ini.Key

func Init

func Init(conf_path string) error

func RegisterParser

func RegisterParser(f ParseFunc)

Types

type ParseFunc

type ParseFunc func(*ini.File) error

Jump to

Keyboard shortcuts

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