config

package
v0.0.0-...-066ace4 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(path string)

func Parse

func Parse(env string)

Types

type AdminConfig

type AdminConfig struct {
	Debug  bool           `json:"debug"`
	Logger *LoggerConfig  `json:"logger"`
	Gin    *GinConfig     `json:"gin`
	MySql  []*MySqlConfig `json:"mysql"`
	Redis  []*RedisConfig `json:"redis"`
}

func Get

func Get() *AdminConfig

func (*AdminConfig) IsDebug

func (a *AdminConfig) IsDebug() bool

type GinConfig

type GinConfig struct {
	View               string `json:"view"`
	StaticRelativePath string `json:"staticRelativePath"`
	StaticRootPath     string `json:"staticRootPath"`
	Favicon            string `json:"favicon"`
	FaviconPath        string `json:"faviconPath"`
	URL                string `json:"url"`
	Port               int    `json:"port"`
}

type LoggerConfig

type LoggerConfig struct {
	Path         string `json:"path"`
	Suffix       string `json:"suffix"`
	Level        string `json:"level"`
	IsWriteFile  bool   `json:"isWriteFile"`
	MaxAge       int    `json:"maxAge"`
	RotationHour int    `json:"rotationHour"`
}

func (*LoggerConfig) GetFileName

func (l *LoggerConfig) GetFileName() string

func (*LoggerConfig) GetLevel

func (l *LoggerConfig) GetLevel() zapcore.Level

type MySqlConfig

type MySqlConfig struct {
	Enable         bool   `json:"enable"`
	GroupId        string `json:"groupId"`
	Id             string `json:"id"`
	DbName         string `json:"dbName"`
	Host           string `json:"host"`
	UserName       string `json:"userName"`
	Password       string `json:"password"`
	MaxIdleConnect int    `json:"maxIdleConnect"`
	MaXOpenConnect int    `json:"maxOpenConnect"`
	LogMode        bool   `json:"logMode"`
}

type RedisConfig

type RedisConfig struct {
	Id             string `json:"id"`
	Host           string `json:"host"`
	Port           int    `json:"port"`
	Password       string `json:"password"`
	MaxConnect     int    `json:"maxConnect"`
	MaxIdleConnect int    `json:"maxIdleConnect"`
	MinIdleConnect int    `json:"minIdleConnect"`
}

Jump to

Keyboard shortcuts

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