config

package
v0.0.0-...-a436ee8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	BaseDomain: "example.com",
	AutoSignUp: true,
	PassSignIn: false,
	HTTPServer: HTTPServerConfig{
		Enable: true,
		Addr:   "0.0.0.0:8080",
		TLS:    TLSConfig{Enable: false},
	},
	GateServer: []GateServerConfig{{
		Name:        "os_beta01",
		Title:       "127.0.0.1:22101",
		DispatchUrl: "http://127.0.0.1:8080/query_cur_region",
	}, {
		Name:  "os_beta02",
		Title: "127.0.0.1:22102",
		Addr:  "127.0.0.1:22102",
	}},
	GameServer: GameServerConfig{
		Enable: true,
		Addr:   "0.0.0.0:22102",
	},
	Database: DatabaseConfig{
		Driver: "sqlite",
		DSN:    "file:data/hk4e-emu.db?cache=shared&mode=rwc",
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	BaseDomain string             `mapstructure:"baseDomain"`
	AutoSignUp bool               `mapstructure:"autoSignUp"`
	PassSignIn bool               `mapstructure:"passSignIn"`
	HTTPServer HTTPServerConfig   `mapstructure:"httpServer"`
	GateServer []GateServerConfig `mapstructure:"gateServer"`
	GameServer GameServerConfig   `mapstructure:"gameServer"`
	Database   DatabaseConfig     `mapstructure:"database"`
}

func LoadConfig

func LoadConfig() (cfg Config)

type DatabaseConfig

type DatabaseConfig struct {
	Driver string `mapstructure:"driver"`
	DSN    string `mapstructure:"dsn"`
}

type GameServerConfig

type GameServerConfig struct {
	Enable bool   `mapstructure:"enable"`
	Addr   string `mapstructure:"addr"`
}

type GateServerConfig

type GateServerConfig struct {
	Name        string `mapstructure:"name"`
	Title       string `mapstructure:"title"`
	Addr        string `mapstructure:"addr"`
	DispatchUrl string `mapstructure:"dispatchUrl"`
}

type HTTPServerConfig

type HTTPServerConfig struct {
	Enable bool      `mapstructure:"enable"`
	Addr   string    `mapstructure:"addr"`
	TLS    TLSConfig `mapstructure:"tls"`
}

type TLSConfig

type TLSConfig struct {
	Enable   bool   `mapstructure:"enable"`
	Addr     string `mapstructure:"addr"`
	CertFile string `mapstructure:"certFile"`
	KeyFile  string `mapstructure:"keyFile"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL