config

package
v0.0.0-...-1d4e844 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Server    ServerConfig    `mapstructure:"server"`
	Minecraft MinecraftConfig `mapstructure:"minecraft"`
}

Root Config structure.

func MustGetConfig

func MustGetConfig(filename string) *Config

Initialize Configuration on startup.

type LogWebhookConfig

type LogWebhookConfig struct {
	DiscordURL string `mapstructure:"discord"`
	SlackURL   string `mapstructure:"slack"`
	// threshold for debouncing log stream, unit: millisecond
	DebounceThreshold int `mapstructure:"debounce_threshold"`
}

type MinecraftConfig

type MinecraftConfig struct {
	JavaCommand       string           `mapstructure:"java_command"`
	JarPath           string           `mapstructure:"jar_path"`
	WorkingDir        string           `mapstructure:"working_dir"`
	JavaOptions       []string         `mapstructure:"java_options"`
	Args              []string         `mapstructure:"args"`
	SkipStartForDebug bool             `mapstructure:"skip_start_for_debug"`
	LogWebhook        LogWebhookConfig `mapstructure:"log_webhook"`
}

type ServerConfig

type ServerConfig struct {
	// Hostname and Port to listen. Example: 0.0.0.0:8000
	Host string `mapstructure:"host"`
	// Print debug messages if true.
	Debug bool `mapstructure:"debug"`
	// Static file path
	StaticPath string `mapstructure:"static_path"`
	// Template file path
	TemplatePath string `mapstructure:"template_path"`
	// Temporary directory path
	TemporaryPath string `mapstructure:"temporary_path"`
	// Environment Variable Key for password
	PasswordEnvKey string `mapstructure:"password_env_key"`
	// Export "HOST:PORT/mods" page as a download link.
	ExportModDownloadLink bool `mapstructure:"export_mod_download_link"`
}

Jump to

Keyboard shortcuts

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