config

package
v0.1.39 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const GlobalConfigPath = "/etc/srcds_controller/config.yaml"

GlobalConfigPath default global config file path

Variables

This section is empty.

Functions

This section is empty.

Types

type ACL

type ACL struct {
	Users  []int `yaml:"users"`
	Groups []int `yaml:"groups"`
}

ACL ACL info

type Check

type Check struct {
	Limit *Limit    `yaml:"limit"`
	Name  string    `yaml:"name"`
	Opts  CheckOpts `yaml:"opts"`
}

Check config for a check, see `pkg/checks/` for available checks

type CheckOpts

type CheckOpts map[string]string

CheckOpts options that can be set for a check

type Checker

type Checker struct {
	Interval time.Duration `yamk:"interval"`
	Splay    *Splay        `yaml:"splay"`
}

Checker config for the checker.Checker

type Config

type Config struct {
	General *General             `yaml:"general"`
	Docker  *Docker              `yaml:"docker"`
	Server  *Server              `yaml:"server"`
	Checker *Checker             `yaml:"checker"`
	Checks  map[string]CheckOpts `yaml:"checks"`
}

Config config file struct

var (
	Cfg *Config
)

Cfg variables holding the Config

func (*Config) Verify

func (c *Config) Verify() error

Verify verify the config file

type Docker

type Docker struct {
	AdditionalEnvVars []string `yaml:"additionalEnvVars"`
	AdditionalMounts  []string `yaml:"additionalMounts"`
	Image             *string  `yaml:"image"`
	LocalTimeFile     string   `yaml:"localTimeFile"`
	NamePrefix        string   `yaml:"namePrefix"`
	TimezoneFile      string   `yaml:"timezoneFile"`
}

Docker config options for Docker connection and/or image used.

type General

type General struct {
	Umask int `yaml:"umask"`
}

General general config options

type GlobalConfig

type GlobalConfig struct {
	General *General             `yaml:"general"`
	Docker  *Docker              `yaml:"docker"`
	Checker *Checker             `yaml:"checker"`
	Checks  map[string]CheckOpts `yaml:"checks"`
}

GlobalConfig global config file always read from `/etc/srcds_controller/config.yaml`

type Limit

type Limit struct {
	After      time.Duration `yaml:"after"`
	Count      int64         `yaml:"count"`
	Actions    []string      `yaml:"actions"`
	ActionOpts CheckOpts     `yaml:"actionOpts"`
}

Limit config with limits and actions ot execute when the limits (after or count) have been reached

type MapSelection added in v0.0.16

type MapSelection struct {
	Enabled     bool   `yaml:"enabled"`
	FileFilter  string `yaml:"fileFilter"`
	FallbackMap string `yaml:"fallbackMap"`
}

MapSelection map selection config

type RCON

type RCON struct {
	Password string `yaml:"password"`
}

RCON rcon info

type RunOptions

type RunOptions struct {
	UID     int    `yaml:"uid"`
	GID     int    `yaml:"gid"`
	HomeDir string `yaml:"homeDir"`
}

RunOptions run options such as user and group id to run the server as.

type Server

type Server struct {
	Name          string               `yaml:"name"`
	Enabled       bool                 `yaml:"enabled"`
	Address       string               `yaml:"address"`
	Port          int                  `yaml:"port"`
	MountsDir     string               `yaml:"mountsDir"`
	Command       string               `yaml:"command"`
	Flags         []string             `yaml:"flags"`
	MapSelection  *MapSelection        `yaml:"mapSelection"`
	RCON          *RCON                `yaml:"rcon"`
	Checks        []Check              `yaml:"checks"`
	OnExitCommand string               `yaml:"onExitCommand"`
	GameID        int64                `yaml:"gameID"`
	Resources     *container.Resources `yaml:"resources,omitempty"`
	RunOptions    RunOptions           `yaml:"runOptions"`
	ACL           *ACL                 `yaml:"acl"`
	SteamCMDDir   string               `yaml:"steamCMDDir"`
	Path          string
}

Server config/info for a server

type Servers

type Servers []*Server

Servers list of Server

type Splay

type Splay struct {
	Start int `yaml:"start"`
	End   int `yaml:"end"`
}

Splay time splay config

Jump to

Keyboard shortcuts

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