config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var App *app // App配置

Env值映射为Gin的运行环境值

View Source
var Log *logger // 日志配置
View Source
var Mysql *mysql // Mysql数据库
View Source
var Postgres *[]postgres // Postgres数据库

var Redis map[string]redis // Redis配置

View Source
var TPL = `` /* 2157-byte string literal not displayed */

用于初始化系统配置文件,须优先维护。

Functions

func GinEnv

func GinEnv() string

将运行环境映射为Gin的运行环境

func Init

func Init()

Types

type Env

type Env string

运行环境

const (
	Env_DEV   Env = "dev"   // 开发环境
	Env_TEST  Env = "test"  // 测试环境
	Env_Stage Env = "stage" // 验收环境
	Env_PROD  Env = "prod"  // 生产环境
)

运行环境常量 参考:https://en.wikipedia.org/wiki/Deployment_environment

func GoEnv

func GoEnv() Env

获取运行环境 获取系统环境变量GOENV,缺省值为

Jump to

Keyboard shortcuts

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