configs

package
v1.1.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const EnvDBHostKey = "MYSQL_HOST"
View Source
const EnvDBNameKey = "MYSQL_DBNAME"
View Source
const EnvDBPassKey = "MYSQL_PASS"
View Source
const EnvDBPortKey = "MYSQL_PORT"
View Source
const EnvDBUserKey = "MYSQL_USER"
View Source
const EnvLogLevel = "ENV_LOG_LEVEL"
View Source
const EnvLoginGrpcPortKey = "LOGIN_GRPC_PORT"
View Source
const EnvLoginHttpPortKey = "LOGIN_HTTP_PORT"
View Source
const EnvLoginIpKey = "LOGIN_IP"
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) 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 GrpcLoginConfigs added in v1.1.1

type GrpcLoginConfigs struct {
	Ip   string
	Port int
	Config
}

func (*GrpcLoginConfigs) Format added in v1.1.1

func (grpcLoginConfigs *GrpcLoginConfigs) Format() string

type HttpLoginConfigs

type HttpLoginConfigs struct {
	Ip   string
	Port int
	Config
}

func (*HttpLoginConfigs) Format

func (httpLoginConfigs *HttpLoginConfigs) Format() string

type LoginServerConfigs

type LoginServerConfigs struct {
	Http        HttpLoginConfigs
	Grpc        GrpcLoginConfigs
	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

Jump to

Keyboard shortcuts

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