g

package
v0.0.0-...-fa8172e Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ConfigFile string
)

Functions

func InitLog

func InitLog()

func LoadConfig

func LoadConfig(cfgFile string)

加载配置文件

Types

type Config

type Config struct {
	Run   RunConfig   `toml:"run"`
	Log   LogConfig   `toml:"log"`
	Mysql MysqlConfig `toml:"mysql"`
	Jwt   JwtConfig   `toml:"jwt"`
	Nsq   NsqConfig   `toml:"nsq"`
	Repo  RepoConfig  `toml:"repo"`
}

func Conf

func Conf() *Config

type JwtConfig

type JwtConfig struct {
	EncodeMethod     string `toml:"encodeMethod"`
	MaxEffectiveTime int64  `toml:"maxEffectiveTime"`
}

type LogConfig

type LogConfig struct {
	Enable    bool   `toml:"enable"`
	Path      string `toml:"path"`
	Level     string `toml:"level"`
	RotatTime int    `toml:"rotatTime"`
	MaxAge    int    `toml:"maxAge"`
}

type MysqlConfig

type MysqlConfig struct {
	MaxIdle int    `toml:"maxIdle"`
	MaxOpen int    `toml:"maxOpen"`
	Debug   bool   `toml:"debug"`
	WebAddr string `toml:"webAddr"`
}

type NsqConfig

type NsqConfig struct {
	Lookupds      []string `toml:"lookupds"`
	DeployTopic   string   `toml:"deployTopic"`
	DeployChannel string   `toml:"deployChannel"`
	HandlerCount  int      `toml:"handlerCount"`
}

type RepoConfig

type RepoConfig struct {
	IsHost int    `toml:"isHost"`
	Host   string `toml:"host"`
	IsIp   int    `toml:"isIp"`
	Ip     string `toml:"ip"`
	Port   string `toml:"port"`
}

type RunConfig

type RunConfig struct {
	WaitTimeout int    `toml:"waitTimeout"`
	HTTPPort    int    `toml:"httpPort"`
	Mode        string `toml:"mode"`
	MaxAllowed  int    `toml:"maxAllowed"`
}

Jump to

Keyboard shortcuts

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