config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: MIT Imports: 6 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
	AppId          string
	HttpServer     *HttpServer
	MySQL          *MySQL
	Reg            *Reg
	LogicRPCClient *RPCClient
	IdGenRPCClient *RPCClient
	//PusherRPCClient *RPCClient
	AnswerRPCClient *RPCClient
	//gRPC server
	GRPCServer      *grpc.ServerConfig
	GroupInfoConfig *GroupDefault
	Redis           *redis.Config
}
var (
	Conf *Config
)

func Default

func Default() *Config

type GroupDefault

type GroupDefault struct {
	// 群人数上限 [200, 2000]
	GroupMaximum int32
	// 群管理员人数上限 [10, 10]
	AdminNum int32
}

type HttpServer

type HttpServer struct {
	Addr string
}

type MySQL

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

type RPCClient

type RPCClient struct {
	RegAddrs string
	Schema   string
	SrvName  string // call
	Dial     xtime.Duration
	Timeout  xtime.Duration
}

RPCClient is RPC client config.

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