conf

package
v0.0.0-...-8062269 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Conf config
	Conf = &Config{}
)

Functions

func Init

func Init() (err error)

Init init config.

Types

type Bucket

type Bucket struct {
	Size          int
	Channel       int
	Room          int
	RoutineAmount uint64
	RoutineSize   int
}

Bucket is bucket config.

type Config

type Config struct {
	Debug     bool
	Env       *Env
	Discovery *Discovery
	TCP       *TCP
	Websocket *Websocket
	Protocol  *Protocol
	Bucket    *Bucket
	RPCClient *RPCClient
	RPCServer *RPCServer
	Whitelist *Whitelist
	Log       *log.Config
}

Config is comet config.

func (*Config) DiscoveryConfig

func (c *Config) DiscoveryConfig() *naming.Config

DiscoveryConfig 创建发现服务配置

func (*Config) Set

func (c *Config) Set(content string) (err error)

Set config setter.

type Discovery

type Discovery struct {
	Nodes []string
}

Discovery is discovery config.

type Env

type Env struct {
	Region    string
	Zone      string
	DeployEnv string
	Host      string
	Weight    int64
	Offline   bool
	Addrs     []string
}

Env is env config.

type Protocol

type Protocol struct {
	Timer            int
	TimerSize        int
	SvrProto         int
	CliProto         int
	HandshakeTimeout xtime.Duration
}

Protocol is protocol config.

type RPCClient

type RPCClient struct {
	Dial    xtime.Duration
	Timeout xtime.Duration
}

RPCClient is RPC client config.

type RPCServer

type RPCServer struct {
	Network           string
	Addr              string
	Timeout           xtime.Duration
	IdleTimeout       xtime.Duration
	MaxLifeTime       xtime.Duration
	ForceCloseWait    xtime.Duration
	KeepAliveInterval xtime.Duration
	KeepAliveTimeout  xtime.Duration
}

RPCServer is RPC server config.

type TCP

type TCP struct {
	Bind         []string
	Sndbuf       int
	Rcvbuf       int
	KeepAlive    bool
	Reader       int
	ReadBuf      int
	ReadBufSize  int
	Writer       int
	WriteBuf     int
	WriteBufSize int
}

TCP is tcp config.

type Websocket

type Websocket struct {
	Bind        []string
	TLSOpen     bool
	TLSBind     []string
	CertFile    string
	PrivateFile string
}

Websocket is websocket config.

type Whitelist

type Whitelist struct {
	Whitelist []int64
	WhiteLog  string
}

Whitelist is white list config.

Jump to

Keyboard shortcuts

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