config

package
v0.0.0-...-fb7e41f Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrentConfig  AppConfig
	CurrentBaseDir string
)

Functions

func SetBaseDir

func SetBaseDir(baseDir string)

Types

type AppConfig

type AppConfig struct {
	XMLName    xml.Name    `xml:"config"`
	Log        Log         `xml:"log"`
	HttpServer HttpServer  `xml:"httpserver"`
	Redises    []RedisInfo `xml:"redises>redis"`
}

配置信息

func InitConfig

func InitConfig(configFile string) *AppConfig

初始化配置文件

type HttpServer

type HttpServer struct {
	HttpPort  int `xml:"httpport,attr"`
	PProfPort int `xml:"pprofport,attr"`
}

全局配置

type Log

type Log struct {
	FilePath string `xml:"filepath,attr"`
}

log配置

type RedisInfo

type RedisInfo struct {
	ID       string `xml:"id,attr"`
	ServerIP string `xml:"serverip,attr"`
	KeyPre   string `xml:"keypre,attr"`
}

Redis信息

func GetRedisInfo

func GetRedisInfo(redisID string) (*RedisInfo, bool)

Jump to

Keyboard shortcuts

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