config

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DB     DataBase // 配置文件数据库对象
	HTTP   HTTP     // HTTP 协议配置对象
	Logger Logger   // Logger 配置对象
}

Config 全局JSON配置对象

func Configure

func Configure() *Config

Configure 获取配置对象

type DataBase

type DataBase struct {
	Driver string // 数据库驱动
	Source string // 连接字符串

	ShowSQL bool // 是否显示 SQL 语句

	MaxOpenConns int // 数据库连接池数量
	MaxIdleConns int // 数据库连接最大空闲数

	Cached            int  // 缓存大小
	UserManageDisable bool //是否开启用户管理
}

DataBase 数据库连接对象

type HTTP

type HTTP struct {
	TLS      bool
	Address  string // 地址
	CertFile string //证书验证文件
	KeyFile  string // 证书
}

HTTP HTTP协议配置对象

type Logger

type Logger struct {
	Level       string // 日志等级:日志等级: debug,info,warn,error,dpanic,panic,fatal
	Development bool   // 是否开启开发模式
	Encoding    string // 日志输出格式
	AppLogsPath string // 日志文件输出位置
}

Logger 日志对象

type Register

type Register struct {
}

Register 配置对象注册器

func (Register) Regist

func (Register) Regist()

Regist 实现 IRegister 接口,以注册获取初始化好的 config 对象。

Jump to

Keyboard shortcuts

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