configs

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const EnvDBHostKey = "DB_HOSTNAME"
View Source
const EnvDBNameKey = "DB_DATABASE"
View Source
const EnvDBPassKey = "DB_PASSWORD"
View Source
const EnvDBPortKey = "DB_PORT"
View Source
const EnvDBUserKey = "DB_USERNAME"
View Source
const EnvLogLevel = "ENV_LOG_LEVEL"
View Source
const EnvLoginHttpPortKey = "LOGIN_HTTP_PORT"
View Source
const EnvLoginIpKey = "LOGIN_IP"
View Source
const EnvLoginTcpPortKey = "LOGIN_TCP_PORT"
View Source
const EnvRateLimiterBurstKey = "RATE_LIMITER_BURST"
View Source
const EnvRateLimiterRateKey = "RATE_LIMITER_RATE"
View Source
const EnvServerIpKey = "SERVER_IP"
View Source
const EnvServerLocationKey = "SERVER_LOCATION"
View Source
const EnvServerNameKey = "SERVER_NAME"
View Source
const EnvServerPortKey = "SERVER_PORT"
View Source
const EnvVocations = "VOCATIONS"

Variables

This section is empty.

Functions

func GetEnvInt

func GetEnvInt(key string, defaultValue ...int) int

func GetEnvStr

func GetEnvStr(key string, defaultValue ...string) string

func GetLogLevel

func GetLogLevel() logrus.Level

func GetServerVocations

func GetServerVocations() []string

func Init

func Init() error

Init only works for variables that are not yet defined. /*

Types

type Config

type Config interface {
	Format() string
}

type DBConfigs

type DBConfigs struct {
	Host string
	Port int
	Name string
	User string
	Pass string
	Config
}

func GetDBConfigs

func GetDBConfigs() DBConfigs

func (*DBConfigs) Format

func (dbConfigs *DBConfigs) Format() string

func (*DBConfigs) GetConnectionString

func (dbConfigs *DBConfigs) GetConnectionString() string

type GameServerConfigs

type GameServerConfigs struct {
	Port     int
	Name     string
	IP       string
	Location string
	Config
}

func GetGameServerConfigs

func GetGameServerConfigs() GameServerConfigs

func (*GameServerConfigs) Format

func (gameServerConfigs *GameServerConfigs) Format() string

type GlobalConfigs

type GlobalConfigs struct {
	DBConfigs          DBConfigs
	GameServerConfigs  GameServerConfigs
	LoginServerConfigs LoginServerConfigs
}

func GetGlobalConfigs

func GetGlobalConfigs() GlobalConfigs

func (*GlobalConfigs) Display

func (c *GlobalConfigs) Display()

type HttpLoginConfigs

type HttpLoginConfigs struct {
	Ip   string
	Port int
	Config
}

func GetHttpLoginConfigs

func GetHttpLoginConfigs() HttpLoginConfigs

func (*HttpLoginConfigs) Format

func (httpLoginConfigs *HttpLoginConfigs) Format() string

type LoginServerConfigs

type LoginServerConfigs struct {
	Http        HttpLoginConfigs
	Tcp         TcpLoginConfigs
	RateLimiter RateLimiter
	Config
}

func GetLoginServerConfigs

func GetLoginServerConfigs() LoginServerConfigs

func (*LoginServerConfigs) Format

func (loginServerConfigs *LoginServerConfigs) Format() string

type RateLimiter

type RateLimiter struct {
	Burst int
	Rate  rate.Limit
	Config
}

func GetRateLimiterConfigs

func GetRateLimiterConfigs() RateLimiter

func (*RateLimiter) Format

func (rateLimiterConfigs *RateLimiter) Format() string

type TcpLoginConfigs

type TcpLoginConfigs struct {
	Ip   string
	Port int
	Config
}

func GetTcpLoginConfigs

func GetTcpLoginConfigs() TcpLoginConfigs

func (*TcpLoginConfigs) Format

func (tcpLoginConfigs *TcpLoginConfigs) Format() string

Jump to

Keyboard shortcuts

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