config

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

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECODE_OK        = "0"
	RECODE_UNKNOWERR = "678"
	RECODE_DBERR     = "4001"
)

Variables

View Source
var (
	AppName     string //项目名称
	HttpAddr    string //服务器ip地址
	HttpPort    string //服务器端口
	RunMode     string //运行模式
	RedisDbnum  string //redis db 编号
	MysqlDbname string //mysql db name
	MysqlUrl    string //mysql 地址
	RedisUrl    string //redis 地址

	ConsulCfg ConSulConfig
)
View Source
var AppLogLevel string
View Source
var ConsulKV *consulApi.KV
View Source
var EmailList = []string{""}

Functions

func ConsulUnmarshal

func ConsulUnmarshal(path string, config interface{}) (err error)

从consul web读取json k/v

func InitConfig

func InitConfig()

func RecodeText

func RecodeText(code string) string

Types

type ConSulConfig

type ConSulConfig struct {
	//告警商户
	EmailMerchant string
	//告警内容
	AlertEmail string
	//consul 地址
	ConsulAddr string
}

从本地json读取 consul报警邮件配置

type Global

type Global struct {
	AlertEmailToUser   string
	AlertEmailUrl      string
	AlertEmailMerchant string
}

Alert Email

var GlobalMap Global

func GetGlobalMap

func GetGlobalMap() Global

Jump to

Keyboard shortcuts

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