cfg

package
v0.0.0-...-3e386e2 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init()

Types

type Config

type Config struct {
	Debug   bool
	Logger  Logger
	Mysql   Mysql
	Redis   Redis
	Mongodb Mongodb
}
var App Config

type Logger

type Logger struct {
	Level        string        // 日志级别
	Path         string        // 路径
	Name         string        // 文件名称
	Console      bool          // 是否输出到控制台
	MaxAge       time.Duration // 保存多久的日志,默认15天
	RotationTime time.Duration // 多久分割一次日志
	Caller       bool          // 是否打印文件行号
	SplitLevel   bool          // 是否把不同级别的日志打到不同文件
}

Logger 日志配置

type Mongodb

type Mongodb struct {
	Uri      string
	Database string
	Timeout  time.Duration
}

type Mysql

type Mysql struct {
	Host      string
	Port      string
	Database  string
	Username  string
	Password  string
	Charset   string
	Collation string
	Prefix    string
	Engine    string
	Debug     bool
}

Mysql 配置

type Redis

type Redis struct {
	Host     string
	Port     int
	Password string
}

Redis 配置

Jump to

Keyboard shortcuts

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