goworld: github.com/xiaonanln/goworld/engine/config Index | Files

package config

import "github.com/xiaonanln/goworld/engine/config"

Index

Package Files

read_config.go

func Debug Uses

func Debug() bool

func DumpPretty Uses

func DumpPretty(cfg interface{}) string

DumpPretty format config to string in pretty format

func GetConfigDir Uses

func GetConfigDir() string

GetConfigDir returns the directory of goworld.ini

func GetConfigFilePath Uses

func GetConfigFilePath() string

GetConfigFilePath returns the config file path

func GetDispatcherIDs Uses

func GetDispatcherIDs() []uint16

GetDispatcherIDs returns all dispatcher IDs

func SetConfigFile Uses

func SetConfigFile(f string)

SetConfigFile sets the config file path (goworld.ini by default)

type DebugConfig Uses

type DebugConfig struct {
    Debug bool
}

type DeploymentConfig Uses

type DeploymentConfig struct {
    DesiredGames int `ini:"desired_games"`
    DesiredGates int `ini:"desired_gates"`
}

DeploymentConfig defines fields of deployment config

func GetDeployment Uses

func GetDeployment() *DeploymentConfig

type DispatcherConfig Uses

type DispatcherConfig struct {
    ListenAddr    string
    AdvertiseAddr string
    HTTPAddr      string
    LogFile       string
    LogStderr     bool
    LogLevel      string
}

DispatcherConfig defines fields of dispatcher config

func GetDispatcher Uses

func GetDispatcher(dispid uint16) *DispatcherConfig

GetDispatcher returns the dispatcher config

type GameConfig Uses

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 Uses

func GetGame(gameid uint16) *GameConfig

GetGame gets the game config of specified game ID

type GateConfig Uses

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 Uses

func GetGate(gateid uint16) *GateConfig

GetGate gets the gate config of specified gate ID

type GoWorldConfig Uses

type GoWorldConfig struct {
    Deployment       DeploymentConfig
    DispatcherCommon DispatcherConfig
    GameCommon       GameConfig
    GateCommon       GateConfig
    Dispatchers      map[uint16]*DispatcherConfig

    Storage StorageConfig
    KVDB    KVDBConfig
    Debug   DebugConfig
    // contains filtered or unexported fields
}

GoWorldConfig defines the total GoWorld config file structure

func Get Uses

func Get() *GoWorldConfig

Get returns the total GoWorld config

func Reload Uses

func Reload() *GoWorldConfig

Reload forces goworld server to reload the whole config

type KVDBConfig Uses

type KVDBConfig struct {
    Type       string
    Url        string // MongoDB
    DB         string // MongoDB
    Collection string // MongoDB
    Driver     string // SQL Driver: e.x. mysql
    StartNodes common.StringSet
}

KVDBConfig defines fields of KVDB config

func GetKVDB Uses

func GetKVDB() *KVDBConfig

GetKVDB returns the KVDB config

type StorageConfig Uses

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

func GetStorage Uses

func GetStorage() *StorageConfig

GetStorage returns the storage config

Package config imports 12 packages (graph) and is imported by 9 packages. Updated 2018-09-14. Refresh now. Tools for package owners.