config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2022 License: MIT Imports: 5 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
	MySQL  *MySQL
	Reg    *Reg
	//gRPC server
	GRPCServer *grpc.ServerConfig
	Key        *Key
}
var (
	Conf *Config
)

func Default

func Default() *Config

type HttpServer

type HttpServer struct {
	Addr string
}

type Key

type Key struct {
	KeyExpireDuration time.Duration
}

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

Jump to

Keyboard shortcuts

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