config

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2024 License: BSD-3-Clause Imports: 18 Imported by: 10

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CmsConfig

type CmsConfig struct {
	UserId           uint   `json:"dotlanUserId"`
	TournamentFilter string `json:"dotlanTournamentFilter"`
	DefaultGame      string `json:"defaultGame"`
}

type Config

type Config struct {
	Templates            map[string]string          `json:"templates,omitempty"`
	CmsConfig            CmsConfig                  `json:"cmsConfig"`
	UpdateDotlanOnEvents []messagebroker.MatchEvent `json:"updateDotlanOnEvents"`
	UnwindiaPteroConfig  `json:"pterodactyl"`
}

type ConfigClient

type ConfigClient interface {
	GetConfig() *Config
	GetGameServerTemplate(gameName string) (*GamerServerConfigTemplate, error)
	GetGameServerTemplateForMatch(info matchservice.MatchInfo) (*GamerServerConfigTemplate, error)
}

func NewConfigClient

func NewConfigClient() (ConfigClient, error)

func NewConfigFile

func NewConfigFile(ctx context.Context, filename, templatesDirectory string) (ConfigClient, error)

type ConfigClientImpl

type ConfigClientImpl struct {
	// contains filtered or unexported fields
}

func (ConfigClientImpl) GetConfig

func (c ConfigClientImpl) GetConfig() *Config

TODO: Implement client for config service

func (ConfigClientImpl) GetGameServerTemplate added in v0.0.6

func (c ConfigClientImpl) GetGameServerTemplate(gameName string) (*GamerServerConfigTemplate, error)

func (ConfigClientImpl) GetGameServerTemplateForMatch added in v0.0.6

func (c ConfigClientImpl) GetGameServerTemplateForMatch(info matchservice.MatchInfo) (*GamerServerConfigTemplate, error)

type ConfigFileImpl

type ConfigFileImpl struct {
	// contains filtered or unexported fields
}

func (*ConfigFileImpl) GetConfig

func (c *ConfigFileImpl) GetConfig() *Config

func (*ConfigFileImpl) GetGameServerTemplate added in v0.0.6

func (c *ConfigFileImpl) GetGameServerTemplate(gameName string) (*GamerServerConfigTemplate, error)

func (*ConfigFileImpl) GetGameServerTemplateForMatch added in v0.0.6

func (c *ConfigFileImpl) GetGameServerTemplateForMatch(info matchservice.MatchInfo) (*GamerServerConfigTemplate, error)

type Duration added in v0.0.6

type Duration struct {
	time.Duration
}

func (Duration) MarshalJSON added in v0.0.6

func (d Duration) MarshalJSON() ([]byte, error)

func (*Duration) UnmarshalJSON added in v0.0.6

func (d *Duration) UnmarshalJSON(b []byte) error

type GamerServerConfigTemplate added in v0.0.6

type GamerServerConfigTemplate struct {
	UserId                int                    `json:"userId"`
	LocationId            int                    `json:"locationId"`
	NestId                int                    `json:"nestId"`
	ServerNamePrefix      string                 `json:"serverNamePrefix"`
	ServerNameGOTVPrefix  string                 `json:"serverNameGOTVPrefix"`
	DefaultStartup        string                 `json:"defaultStartup"`
	DefaultDockerImage    string                 `json:"defaultDockerImage"`
	DefaultServerPassword string                 `json:"defaultServerPassword"`
	DefaultRconPassword   string                 `json:"defaultRconPassword"`
	EggId                 int                    `json:"eggId"`
	Limits                crocgodyl.Limits       `json:"limits"`      // Limits which will be set for new servers.
	ForceLimits           bool                   `json:"forceLimits"` // if true, server which does not meet Limits settings will be deleted. If false, existing suspended servers will be reused, no matter of matching Limits
	Environment           map[string]interface{} `json:"environment"` // Environment settings for a game. Can be values or matching properties of a gameserver match thingy object in go-template like format // TODO: set correct object description
	TvSlots               int                    `json:"tvSlots"`
	TvPortOffset          int                    `json:"tvPortOffset"`
	DeleteAfterDuration   Duration               `json:"deleteAfterDuration"`
	SteamApiTokenAppId    int                    `json:"steamApiTokenAppId"`
	EnvironmentMapping    map[string]string      `json:"envMapping"`
}

type UnwindiaPteroConfig added in v0.0.6

type UnwindiaPteroConfig struct {
	Configs map[string]GamerServerConfigTemplate `json:"configs"` // configs is a map which contains the game name as key with belonging template
}

Jump to

Keyboard shortcuts

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