conf

package
v0.0.0-...-b44eeac Latest Latest
Warning

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

Go to latest
Published: May 30, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

README

conf

实现 json 和 ini两种配置文件解析

a := GetInstance()
a.ParseConf("../cmd/server.json","json")

a.ParseConf("../cmd/server.ini","ini")

Documentation

Index

Constants

View Source
const ConsolePrompt string = "fyLeaf# "
View Source
const LenStackBuf = 4096

不太适合修改的值 或者 基本不会改动的值

View Source
const LogV int32 = 3
View Source
const ProfilePath string = ""

Variables

This section is empty.

Functions

func GetInstance

func GetInstance() *singleton

Types

type CfgModify

type CfgModify interface {
	Update(string, string, string) // section,key,value
	Delete(string, string)         // section,key   int:0, bool:false, string:""
}

这个还没有完成,等写完console再说吧

type Config

type Config interface {
	Reload()   //从本地重新载入配置文件
	SaveFile() //保存配置文件到本地
	Update(string, string, string)
	// contains filtered or unexported methods
}

type Mysql

type Mysql struct {
	DBname   string
	DBaddr   string
	DBport   string
	DBuser   string
	DBpasswd string
}

type Server

type Server struct {
	Version     string
	LogLevel    string
	LogPath     string
	WSAddr      string
	CertFile    string
	KeyFile     string
	TCPAddr     string
	MaxConnNum  int32
	ConsolePort int
	ProfilePath string
	Debug       bool
	Mysql       Mysql
}

Jump to

Keyboard shortcuts

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