Documentation
¶
Overview ¶
Package config loads the Factorix configuration from config.toml. The file format is shared with the Ruby implementation, so existing configuration files carry over unchanged.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrInvalidConfig = errors.New("invalid configuration")
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
Download CacheType `toml:"download"`
API CacheType `toml:"api"`
InfoJSON CacheType `toml:"info_json"`
}
Cache holds the per-cache-type settings.
type CacheType ¶
type CacheType struct {
Backend string `toml:"backend"`
TTL *int64 `toml:"ttl"` // seconds; nil = unlimited
FileSystem FileSystemBackend `toml:"file_system"`
// Redis and S3 are accepted so Ruby-era configuration files still load,
// but the backends are out of scope for the Go version and the values
// are ignored.
Redis RedisBackend `toml:"redis"`
S3 S3Backend `toml:"s3"`
}
CacheType configures one cache instance.
type Config ¶
type Config struct {
LogLevel string `toml:"log_level"`
Runtime Runtime `toml:"runtime"`
RCON RCON `toml:"rcon"`
HTTP HTTP `toml:"http"`
Cache Cache `toml:"cache"`
}
Config is the application configuration.
type FileSystemBackend ¶
type FileSystemBackend struct {
MaxFileSize *int64 `toml:"max_file_size"` // bytes; nil = unlimited
CompressionThreshold *int64 `toml:"compression_threshold"` // bytes; nil = never compress
}
FileSystemBackend configures the filesystem cache backend.
type HTTP ¶
type HTTP struct {
ConnectTimeout int `toml:"connect_timeout"`
ReadTimeout int `toml:"read_timeout"`
WriteTimeout int `toml:"write_timeout"`
}
HTTP holds HTTP timeout settings in seconds.
type RCON ¶
type RCON struct {
Host string `toml:"host"`
Port int `toml:"port"`
Password string `toml:"password"`
}
RCON holds RCON connection settings.
type RedisBackend ¶
RedisBackend is accepted for Ruby-file compatibility only.
Click to show internal directories.
Click to hide internal directories.