Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitConfig ¶
func InitConfig()
Types ¶
type Config ¶
type Config struct { Env string `yaml:"env"` // env: product/test/dev RunEnv string `yaml:"run_env"` // run_env: host,k8s LogFile string `yaml:"log_file"` // log_file: gate.log LogLevel string `yaml:"log_level"` // log_level: debug NetTimeout string `yaml:"net_timeout"` // net_timeout: 1000 SendSize string `yaml:"send_size"` // send_size: ReadSize string `yaml:"read_size"` // read_size: RsaKey string `yaml:"rsa_key"` // rsa_key: rsa.key RsaCertificate string `yaml:"rsa_certificate"` // rsa_certificate: rsa.crt CompressConnection string `yaml:"compress_connection"` // compress_connection: false EncryptConnection string `yaml:"encrypt_connection"` // encrypt_connection: false HeartbeatCheckInterval string `yaml:"heartbeat_check_interval"` // heartbeat_check_interval: 0 LocalProxy bool `yaml:"local_proxy"` //proxy 和 game绑定在一起部署 Proxy conf.NetConf `yaml:"proxy"` }
var CFG Config
type Game ¶
type Game struct { entity.Entity // 可以重写这个接口,自己规划EntityID中的ID部分,比如用来承载UID等 IDGenerator EntityMgr *entity.EntityManager // todo DB db.IDatabase // contains filtered or unexported fields }
func (*Game) HandleClose ¶
func (*Game) HandleFail ¶
func (*Game) HandleTimeOut ¶
func (*Game) NewEntityID ¶
NewEntityID 如果没有特殊规划,可以使用这个生成entity id
func (*Game) RegisterServiceToProxy ¶
type IDGenerator ¶
type Option ¶
type Option func(*Game)
func WithIDGenerator ¶
func WithIDGenerator(gener IDGenerator) Option
Click to show internal directories.
Click to hide internal directories.