conf

package
v0.0.0-...-0f6a860 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2020 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DataIdDefault = "srv.sms"
)

Variables

View Source
var (
	Conf Config

	ConfigPath string

	// ******* acm config ***********************
	CFG_ENDPOINT    = GetEnv("CFG_ENDPOINT", "acm.aliyun.com")
	CFG_NAMESPACEID = GetEnv("CFG_NAMESPACEID", "a23c93cd-491c-44dd-be30-fb1df6e6ddaf")
	CFG_ACCESSKEY   = GetEnv("CFG_ACCESSKEY", "")
	CFG_SECRETKEY   = GetEnv("CFG_SECRETKEY", "")
	CFG_CLUSTER     = GetEnv("CFG_CLUSTER", "test")
)

Functions

func CheckErr

func CheckErr(err error)

func GenValidateCode

func GenValidateCode(width int) string

func GetEnv

func GetEnv(key, value string) string

func GetFileConfFile

func GetFileConfFile() string

func InitConfig

func InitConfig()

初始化配置

func ValidateMobile

func ValidateMobile(mobile string) bool

Types

type Config

type Config struct {
	Db  *Db `json:"mysql"`
	Sms struct {
		YunPian *Sms `json:"yunpian"`
	}
}

type Db

type Db struct {
	Host     string
	User     string
	Password string
	Name     string
	Charset  string
	Debug    bool
}

type Sms

type Sms struct {
	Name   string
	APIKey string
	Debug  bool
}

Jump to

Keyboard shortcuts

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