config

package
v0.0.0-...-15b5fa4 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SteamCMDExecutableFile           = "steamcmd.sh"
	DefaultGameServerScriptStart     = "{command}"
	DefaultGameServerScriptStop      = "{command}"
	DefaultGameServerScriptRestart   = "{command}"
	DefaultGameServerScriptStatus    = "{command}"
	DefaultGameServerScriptGetOutput = "{command}"
	DefaultGameServerScriptSendInput = "{command}"
)

Variables

View Source
var (
	ErrEmptyNodeID    = errors.New("empty node ID")
	ErrEmptyAPIHost   = errors.New("empty API Host")
	ErrEmptyAPIKey    = errors.New("empty API Key")
	ErrConfigNotFound = errors.New("configuration file not found")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	NodeID uint `yaml:"ds_id"`

	ListenIP   string `yaml:"listen_ip"`
	ListenPort int    `yaml:"listen_port"`

	APIHost string `yaml:"api_host"`
	APIKey  string `yaml:"api_key"`

	DaemonLogin            string `yaml:"daemon_login"`
	DaemonPassword         string `yaml:"daemon_password"`
	PasswordAuthentication bool   `yaml:"password_authentication"`

	CACertificateFile    string `yaml:"ca_certificate_file"`
	CertificateChainFile string `yaml:"certificate_chain_file"`
	PrivateKeyFile       string `yaml:"private_key_file"`
	PrivateKeyPassword   string `yaml:"private_key_password"`
	DHFile               string `yaml:"dh_file"`

	IFList     []string `yaml:"if_list"`
	DrivesList []string `yaml:"drives_list"`

	StatsUpdatePeriod   int `yaml:"stats_update_period"`
	StatsDBUpdatePeriod int `yaml:"stats_db_update_period"`

	// Log config
	LogLevel  string `yaml:"log_level"`
	OutputLog string `yaml:"output_log"`
	ErrorLog  string `yaml:"error_log"`

	// Dedicated server config
	Path7zip    string `yaml:"path_7zip"`
	PathStarter string `yaml:"path_starter"`

	WorkPath     string `yaml:"work_path"`
	ToolsPath    string `yaml:"tools_path"`
	SteamCMDPath string `yaml:"steamcmd_path"`

	SteamConfig SteamConfig `yaml:"steam_config"`

	Scripts Scripts

	TaskManager struct {
		UpdatePeriod  time.Duration `yaml:"update_period"`
		RunTaskPeriod time.Duration `yaml:"run_task_period"`
		WorkersCount  int           `yaml:"workers_count"`
	} `yaml:"task_manager"`

	ProcessManager struct {
		Name   string            `yaml:"name"`
		Config map[string]string `yaml:"config"`
	} `yaml:"process_manager"`

	Users map[string]string `yaml:"users"`
}

func Load

func Load(path string) (*Config, error)

func NewConfig

func NewConfig() *Config

func (*Config) Init

func (cfg *Config) Init() error

func (*Config) WorkDir

func (cfg *Config) WorkDir() string

type InvalidFileError

type InvalidFileError struct {
	Previous error
	Message  string
}

func NewInvalidFileError

func NewInvalidFileError(message string, previous error) *InvalidFileError

func (*InvalidFileError) Error

func (err *InvalidFileError) Error() string

type NodeConfigInitializer

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

func NewNodeConfigInitializer

func NewNodeConfigInitializer(client contracts.APIRequestMaker) *NodeConfigInitializer

func (*NodeConfigInitializer) Initialize

func (ncu *NodeConfigInitializer) Initialize(ctx context.Context, cfg *Config) error

type Scripts

type Scripts struct {
	Install     string
	Reinstall   string
	Update      string
	Start       string
	Pause       string
	Unpause     string
	Stop        string
	Kill        string
	Restart     string
	Status      string
	GetConsole  string
	SendCommand string
	Delete      string
}

type SteamConfig

type SteamConfig struct {
	Login    string `yaml:"login"`
	Password string `yaml:"password"`
}

Jump to

Keyboard shortcuts

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