Documentation ¶
Index ¶
- func Debug() bool
- func DumpPretty(cfg interface{}) string
- func GetConfigDir() string
- func GetConfigFilePath() string
- func GetDispatcherIDs() []uint16
- func Identifier() string
- func SetConfigFile(f string)
- type DebugConfig
- type DeploymentConfig
- type DispatcherConfig
- type GameConfig
- type GateConfig
- type GoWorldConfig
- type KVDBConfig
- type RankConfig
- type StorageConfig
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 GetConfigFilePath ¶
func GetConfigFilePath() string
GetConfigFilePath returns the config file path
func GetDispatcherIDs ¶
func GetDispatcherIDs() []uint16
GetDispatcherIDs returns all dispatcher IDs
func Identifier ¶
func Identifier() string
func SetConfigFile ¶
func SetConfigFile(f string)
SetConfigFile sets the config file path (goworld.ini by default)
Types ¶
type DebugConfig ¶
type DeploymentConfig ¶
type DeploymentConfig struct { DesiredDispatchers int `ini:"desired_dispatchers"` DesiredGames int `ini:"desired_games"` DesiredGates int `ini:"desired_gates"` }
DeploymentConfig defines fields of deployment config
func GetDeployment ¶
func GetDeployment() *DeploymentConfig
type DispatcherConfig ¶
type DispatcherConfig struct { ListenAddr string AdvertiseAddr string HTTPAddr string LogFile string LogStderr bool LogLevel string }
DispatcherConfig defines fields of dispatcher config
func GetDispatcher ¶
func GetDispatcher(dispid uint16) *DispatcherConfig
GetDispatcher returns the dispatcher config
type GameConfig ¶
type GameConfig struct { BootEntity string SaveInterval time.Duration LogFile string LogStderr bool HTTPAddr string LogLevel string GoMaxProcs int PositionSyncIntervalMS int BanBootEntity bool }
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 { ListenAddr string LogFile string LogStderr bool HTTPAddr string LogLevel string GoMaxProcs int CompressConnection bool CompressFormat string EncryptConnection bool RSAKey string RSACertificate string HeartbeatCheckInterval int PositionSyncIntervalMS 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 { Deployment DeploymentConfig DispatcherCommon DispatcherConfig GameCommon GameConfig GateCommon GateConfig Storage StorageConfig KVDB KVDBConfig Rank RankConfig Debug DebugConfig // contains filtered or unexported fields }
GoWorldConfig defines the total GoWorld config file structure
type KVDBConfig ¶
type KVDBConfig struct { Type string Url string // MongoDB DB string // MongoDB Collection string // MongoDB & Redis Prefix Driver string // SQL Driver: e.x. mysql Auth string StartNodes common.StringSet }
KVDBConfig defines fields of KVDB config
type RankConfig ¶
type RankConfig struct { Type string Url string // Redis Prefix DB string // Redis Prefix string // Redis Auth string // Redis StartNodes common.StringSet }
RankConfig 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) StartNodes common.StringSet }
StorageConfig defines fields of storage config