Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToNacosServerConfigs ¶
func ToNacosServerConfigs(scs []*NacosServerConfig) []constant.ServerConfig
Types ¶
type Configer ¶
type Configer[T any] interface { Get() *T }
Configer provides a way to get the config.
type DelayTimerConfig ¶
type DelayTimerConfig struct {
InviteTimeoutMs int64 `yaml:"invite_timeout_ms"`
MatchTimeoutMs int64 `yaml:"match_timeout_ms"`
WaitAttrTimeoutMs int64 `yaml:"wait_attr_timeout_ms"`
ClearRoomTimeoutMs int64 `yaml:"clear_room_timeout_ms"`
}
DelayTimerConfig defines the delay timer config.
func (DelayTimerConfig) ClearRoomTimeout ¶
func (dtc DelayTimerConfig) ClearRoomTimeout() time.Duration
func (DelayTimerConfig) InviteTimeout ¶
func (dtc DelayTimerConfig) InviteTimeout() time.Duration
func (DelayTimerConfig) MatchTimeout ¶
func (dtc DelayTimerConfig) MatchTimeout() time.Duration
func (DelayTimerConfig) WaitAttrTimeout ¶
func (dtc DelayTimerConfig) WaitAttrTimeout() time.Duration
type DelayTimerType ¶
type DelayTimerType string
const ( DelayTimerTypeAsynq DelayTimerType = "asynq" DelayTimerTypeNative DelayTimerType = "native" )
type FileLoader ¶
FileLoader loads the config from file.
func NewFileLoader ¶
func NewFileLoader[T any](path string) *FileLoader[T]
func (*FileLoader[T]) Get ¶
func (fl *FileLoader[T]) Get() *T
type MatchConfig ¶
type MatchConfig struct {
GroupPlayerLimit int `yaml:"group_player_limit"`
MatchIntervalMs int64 `yaml:"match_interval_ms"`
Glicko2 map[constant.GameMode]*glicko2.QueueArgs `yaml:"glicko2"`
DelayTimerType DelayTimerType `yaml:"delay_timer_type"`
DelayTimerConfig *DelayTimerConfig `yaml:"delay_timer_config"`
}
MatchConfig defines the global match config.
func (*MatchConfig) GetGlicko2QueueArgs ¶
func (c *MatchConfig) GetGlicko2QueueArgs(mode constant.GameMode) *glicko2.QueueArgs
func (*MatchConfig) MatchInterval ¶
func (c *MatchConfig) MatchInterval() time.Duration
type MatchStrategy ¶
type MatchStrategy interface {
GetMatchStrategy(mode constant.GameMode) constant.MatchStrategy
}
type NacosLoader ¶
func NewNacosLoader ¶
func NewNacosLoader(namespaceID, group, dataID string, scs []*NacosServerConfig) *NacosLoader
func (*NacosLoader) Get ¶
func (nl *NacosLoader) Get() *MatchConfig
type NacosServerConfig ¶
type ServerConfig ¶
type ServerConfig struct {
HTTPPort uint64 `yaml:"http_port"`
OtelExporterEndpoint string `yaml:"otel_exporter_endpoint"`
AsynqRedis *RedisOpt `yaml:"asynq_redis"`
NacosNamespaceID string `yaml:"nacos_namespace_id"`
NacosServers []*NacosServerConfig `yaml:"nacos_servers"`
}
ServerConfig defines the server config.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.