Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpPretty ¶
func DumpPretty(cfg interface{}) string
DumpPretty format config to string in pretty format
func SetConfigFile ¶
func SetConfigFile(f string)
SetConfigFile sets the config file path (goworld.ini by default)
Types ¶
type DispatcherConfig ¶
type DispatcherConfig struct { BindIp string BindPort int Ip string Port int LogFile string LogStderr bool HTTPIp string HTTPPort int LogLevel string }
DispatcherConfig defines fields of dispatcher config
func GetDispatcher ¶
func GetDispatcher() *DispatcherConfig
GetDispatcher returns the dispatcher config
type GameConfig ¶
type GameConfig struct { BootEntity string SaveInterval time.Duration LogFile string LogStderr bool HTTPIp string HTTPPort int LogLevel string GoMaxProcs int }
GameConfig defines fields of game config
func GetGame ¶
func GetGame(gameid uint16) *GameConfig
GetGame gets the game config of specified game ID
type GateConfig ¶
type GateConfig struct { Ip string Port int LogFile string LogStderr bool HTTPIp string HTTPPort int LogLevel string GoMaxProcs int CompressConnection bool CompressFormat string EncryptConnection bool RSAKey string RSACertificate string HeartbeatCheckInterval int }
GateConfig defines fields of gate config
func GetGate ¶
func GetGate(gateid uint16) *GateConfig
GetGate gets the gate config of specified gate ID
type GoWorldConfig ¶
type GoWorldConfig struct { Dispatcher DispatcherConfig GameCommon GameConfig GateCommon GateConfig Games map[int]*GameConfig Gates map[int]*GateConfig Storage StorageConfig KVDB KVDBConfig }
GoWorldConfig defines the total GoWorld config file structure
type KVDBConfig ¶
type KVDBConfig struct { Type string Url string // MongoDB DB string // MongoDB Collection string // MongoDB Driver string // SQL Driver: e.x. mysql }
KVDBConfig defines fields of KVDB config
type StorageConfig ¶
type StorageConfig struct { Type string // Type of storage (filesystem, mongodb, redis, mysql) Directory string // Directory of filesystem storage (filesystem) Url string // Connection URL (mongodb, redis, mysql) DB string // Database name (mongodb, redis) Driver string // SQL Driver name (mysql) }
StorageConfig defines fields of storage config
Click to show internal directories.
Click to hide internal directories.