g

package
v0.0.0-...-be240b2 Latest Latest
Warning

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

Go to latest
Published: May 9, 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 GetLogWriter

func GetLogWriter(logPath string, logFileName string, maxAge time.Duration, rotationTime time.Duration) io.Writer

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"`
}

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"`
	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 {
	Address []string `toml:"address"`
}

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