enginemap

package
v0.0.0-...-19f3900 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineOptions

type EngineOptions struct {
	Name                        string         `toml:"name"`
	Args                        []string       `toml:"args"`
	Options                     map[string]any `toml:"options,omitempty"`
	LogEngineString             bool           `toml:"log-engine-string"`
	AllowBadSubstringsInOptions bool           `toml:"allow-bad-substrings-in-options"`
	InitTimeout                 *time.Duration `toml:"init-timeout,omitempty"`
	WaitOnCancelTimeout         *time.Duration `toml:"wait-on-cancel-timeout,omitempty"`
	CreateTimeout               *time.Duration `toml:"create-timeout,omitempty"`
}

func (EngineOptions) Clone

func (o EngineOptions) Clone() EngineOptions

func (EngineOptions) PoolOptions

func (o EngineOptions) PoolOptions(shortName string) (battle.EnginePoolOptions, error)

type Map

type Map interface {
	GetOptions(engine roomapi.JobEngine) (battle.EnginePoolOptions, error)
}

func New

func New(o Options) Map

type Options

type Options struct {
	// Allows all the executables found in PATH to be run as chess engines as fallback.
	// SECURITY: May lead to remote code execution. Use only if you COMPLETELY TRUST THE SERVER AND
	// ALL ITS USERS WHO ARE ALLOWED TO RUN ENGINE CONTESTS.
	AllowPathDangerous bool `toml:"allow-path-dangerous"`

	// Allows all the executable from the given DIRs to be run as chess engines.
	// SECURITY: The server can execute ANY FILE from the provided dirs. Use with EXTREME CARE.
	AllowDirs []string `toml:"allow-dirs"`

	// Default options for engines found with AllowPathDangerous or AllowDirs.
	Default EngineOptions `toml:"default"`

	// Maps engine names to engine options.
	Engines map[string]EngineOptions `toml:"engines"`
}

func (Options) Clone

func (o Options) Clone() Options

Jump to

Keyboard shortcuts

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