Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = &Config{ LogLevel: "Info", GameDataConfigPath: "resources", MysqlDsn: "root:password@tcp(127.0.0.1:3306)/hkrpg-go?charset=utf8mb4&parseTime=True&loc=Local", Account: &Account{ AutoCreate: true, MaxPlayer: -1, }, Http: &Http{ Addr: "0.0.0.0", Port: 8080, }, Https: &Https{ Enable: true, Addr: "0.0.0.0", Port: 8443, CertFile: "data/localhost.crt", KeyFile: "data/localhost.key", }, Dispatch: []Dispatch{ { Name: "hkrpg-go", Title: "os_usa", Type: "2", DispatchUrl: "http://127.0.0.1:8080/query_gateway", }, { Name: "hkrpg-official-os", Title: "OS客户端更新", Type: "2", DispatchUrl: "http://127.0.0.1:8080/query_gateway_capture_os", }, { Name: "hkrpg-official-cn", Title: "CN客户端更新", Type: "2", DispatchUrl: "http://127.0.0.1:8080/query_gateway_capture_cn", }, }, Game: &Game{ Addr: "127.0.0.1", Port: 22102, }, GmKey: "", Email: &email{ From: "123456789@qq.com", Addr: "smtp.qq.com:587", Host: "smtp.qq.com", Identity: "123456789", }, }
View Source
var FileNotExist = errors.New("config file not found")
Functions ¶
func LoadConfig ¶
func LoadConfig() error
Types ¶
type Config ¶
type Config struct { LogLevel string `json:"LogLevel"` GameDataConfigPath string `toml:"GameDataConfigPath"` MysqlDsn string `json:"MysqlDsn"` Account *Account `json:"Account"` Http *Http `json:"Http"` Https *Https `json:"Https"` Dispatch []Dispatch `json:"Dispatch"` Game *Game `json:"Game"` GmKey string `json:"GmKey"` Email *email `json:"Email"` Ec2b *random.Ec2b `json:"Ec2B"` }
Click to show internal directories.
Click to hide internal directories.