config

package
v0.0.0-...-b480da5 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(configFile string)

加载配置文件

func ReLoad

func ReLoad()

Types

type Config

type Config struct {
	Run     RunConfig     `toml:"run"`
	Log     LogConfig     `toml:"log"`
	Mysql   MysqlConfig   `toml:"mysql"`
	Jwt     JwtConfig     `toml:"jwt"`
	Endless EndlessConfig `toml:"endless"`
}

func Get

func Get() Config

type EndlessConfig

type EndlessConfig struct {
	ReadTimeOut    time.Duration `toml:"readTimeOut"`
	WriteTimeOut   time.Duration `toml:"writeTimeOut"`
	MaxHeaderBytes int           `toml:"maxHeaderBytes"`
	HammerTime     time.Duration `toml:"hammerTime"`
}

type JwtConfig

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

type LogConfig

type LogConfig struct {
	Enable     bool   `toml:"enable"`
	Path       string `toml:"path"`
	Level      string `toml:"level"`
	RotateTime int    `toml:"rotateTime"`
	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 RunConfig

type RunConfig struct {
	HTTPAddr   string `toml:"httpAddr"`
	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