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: 9 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 {
	AppId           string
	Engine          string
	Env             string
	Log             xlog.Config
	Trace           traceConfig.Configuration
	LogicRPCClient  *RPCClient
	IdGenRPCClient  *RPCClient
	GroupRPCClient  *RPCClient
	AnswerRPCClient *RPCClient
	DeviceRPCClient *RPCClient
	//gRPC server
	GRPCServer *grpc.ServerConfig
	Reg        *Reg
	Redis      *Redis
	IMSub      *MQSubClient
	RevSub     *MQSubClient
	StorePub   *MQPubServer
	OffPush    *OffPush
}
var (
	Conf *Config
)

func Default

func Default() *Config

type MQPubServer

type MQPubServer struct {
	Brokers []string
}

Kafka .

type MQSubClient

type MQSubClient struct {
	Brokers   []string
	Number    uint32
	MaxWorker int
}

type OffPush

type OffPush struct {
	IsEnabled  bool
	OffPushPub *MQPubServer
}

type RPCClient

type RPCClient struct {
	RegAddrs string // etcd addrs, seperate by ','
	Schema   string
	SrvName  string // call
	Dial     xtime.Duration
	Timeout  xtime.Duration
}

RPCClient is RPC client config.

type Redis

type Redis struct {
	Network      string
	Addr         string
	Auth         string
	Active       int
	Idle         int
	DialTimeout  xtime.Duration
	ReadTimeout  xtime.Duration
	WriteTimeout xtime.Duration
	IdleTimeout  xtime.Duration
	Expire       xtime.Duration
}

Redis .

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