Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
Types ¶
type Bucket ¶
type Bucket struct { HashNum int `yaml:"hashNum"` // Hash切片数量(每个切片是一个Bucket) InitSizeChannelMap int `yaml:"initSizeChannelMap"` // Channel Map的大小(初始大小) InitSizeRoomMap int `yaml:"initSizeRoomMap"` // Room Map的大小(初始大小) RoutineAmount int `yaml:"routineHashNum"` // Hash切片数量:每个切片是一个协程 RoutineChannelSize int `yaml:"routineChannelSize"` // 每个协程拥有一个指定缓冲大小的Channel }
type Config ¶
type Config struct { Env *Env `yaml:"env"` Name string `yaml:"name"` // 服务名 Debug bool `yaml:"debug"` // 是否开启debug Discovery *Discovery `yaml:"discovery"` // etcd的配置 Connect *Connect `yaml:"connect"` // 长连接配置 RPC *RPC `yaml:"rpc"` // RPC配置 Protocol *Protocol `yaml:"protocol"` // 协议配置 Bucket *Bucket `yaml:"bucket"` // 桶配置 }
Config is comet config.
var Conf *Config
type Connect ¶
type Connect struct { TCP *TCP `yaml:"tcp"` Websocket *Websocket `yaml:"websocket"` BufferOptions *bytes.Options `yaml:"bufferOptions"` }
func DefaultConnect ¶
func DefaultConnect() *Connect
type Env ¶
type Env struct { Region string `yaml:"region"` // 地域 Zone string `yaml:"zone"` // 可用区 DeployEnv string `yaml:"deployEnv"` // 部署环境 HostName string `yaml:"host"` // 主机 Weight int64 `yaml:"weight"` // 权重(负载均衡权重) Offline bool `yaml:"offline"` Addrs []string `yaml:"addrs"` }
Env is env config.(暂无使用)
func DefaultEnv ¶
func DefaultEnv() *Env
type RPC ¶
func DefaultRPC ¶
func DefaultRPC() *RPC
type RPCClient ¶
type RPCClient struct { Dial newtime.Duration `yaml:"dial"` Timeout newtime.Duration `yaml:"timeout"` }
RPCClient is RPC client config.
type RPCServer ¶
type RPCServer struct { Network string `yaml:"network"` // 使用协议,如:tcp Addr string `yaml:"addr"` // 服务器地址 Timeout newtime.Duration `yaml:"timeout"` IdleTimeout newtime.Duration `yaml:"idleTimeout"` MaxLifeTime newtime.Duration `yaml:"maxLifeTime"` ForceCloseWait newtime.Duration `yaml:"forceCloseWait"` KeepaliveInterval newtime.Duration `yaml:"keepaliveInterval"` KeepaliveTimeout newtime.Duration `yaml:"keepaliveTimeout"` }
RPCServer is RPC server config.
Click to show internal directories.
Click to hide internal directories.