config

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (err error)

Init init config.

Types

type Config

type Config struct {
	Env    string
	Server *HttpServer
	Reg    *Reg
	//gRPC server
	GRPCServer *grpc.ServerConfig
	MySQL      *MySQL
	SMS        SMS
	Email      Email
	Whitelist  []SMSEmailWhitelist
}
var (
	Conf *Config
)

func Default

func Default() *Config

type Email

type Email struct {
	Surl      string
	AppKey    string
	SecretKey string
	Msg       string
	Env       string
	CodeTypes map[string]string
}

type HttpServer

type HttpServer struct {
	Addr string
}

type MySQL

type MySQL struct {
	Host string
	Port int32
	User string
	Pwd  string
	Db   string
}

type Reg

type Reg struct {
	Schema   string
	SrvName  string // call
	RegAddrs string // etcd addrs, seperate by ','
}

Reg is service register/discovery config

type SMS

type SMS struct {
	Surl      string
	AppKey    string
	SecretKey string
	Msg       string
	Env       string
	CodeTypes map[string]string
}

type SMSEmailWhitelist

type SMSEmailWhitelist struct {
	Account string
	Code    string
	Enable  bool
}

Jump to

Keyboard shortcuts

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