config

package
v0.0.0-...-1fd6b9d Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C_nil_err      = 200 //成功
	C_from_err     = 100 //表单错误
	C_phone_err    = 101 //手机号错误
	C_code_err     = 102 //验证码错误
	S_send_err     = 300 //发送验证码错误
	S_auth_err     = 301 //Token权限校验失败
	S_auth_fmt_err = 302 //Header Token格式错误
	S_Verify_err   = 303 //验证码校验失败
	S_Db_err       = 304
)

Variables

View Source
var (
	Conf = new(conf)

	Cache *redis.Pool
)
View Source
var DB *gorm.DB

Functions

func LoadConfig

func LoadConfig(configFilePath string)

func OrInt

func OrInt(a, b int) int

Types

type DataSourceConfig

type DataSourceConfig struct {
	Username, Password, Host string
	Port                     int
	Database                 string
}

func ParseDataSourceFlag

func ParseDataSourceFlag(source string) (dc *DataSourceConfig, err error)

ParseDataSourceFlag parses format like user:pass@host:port/db.

Jump to

Keyboard shortcuts

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