flag

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(config *Config) error

Types

type BotConfig

type BotConfig struct {
	NotificationMode string          `toml:"notification-mode"`
	LINEConfigs      []LINEConfig    `toml:"line"`
	SlackConfigs     []SlackConfig   `toml:"slack"`
	DiscordConfigs   []DiscordConfig `toml:"discord"`
}

type Config

type Config struct {
	BindAddr          string          `toml:"bind-addr"`
	BindPort          int             `toml:"bind-port"`
	MinecraftHostname string          `toml:"minecraft-hostname"`
	LogLevel          string          `toml:"log-level"`
	Bot               BotConfig       `toml:"bot"`
	Rcon              RconConfig      `toml:"rcon"`
	SharedMem         SharedMemConfig `toml:"sharedmem"`
}

func ArgParse

func ArgParse(version, revision string) (*Config, error)

func ParseConfig

func ParseConfig(filepath string) (*Config, error)

func ScanConfig

func ScanConfig(r io.Reader) (*Config, error)

type DiscordConfig

type DiscordConfig struct {
	Token      string `toml:"token"`
	ChannelIDs string `toml:"channel-ids"`
}

type LINEConfig

type LINEConfig struct {
	Endpoint      string `toml:"endpoint"`
	ChannelSecret string `toml:"channel-secret"`
	ChannelToken  string `toml:"channel-token"`
	GroupIDs      string `toml:"group-ids"`
}

type RconConfig

type RconConfig struct {
	Host     string `toml:"host"`
	Port     int    `toml:"port"`
	Password string `toml:"password"`
}

type RedisConfig

type RedisConfig struct {
	Host string `toml:"host"`
	Port int    `toml:"port"`
}

type SharedMemConfig

type SharedMemConfig struct {
	Mode        string      `toml:"mode"`
	RedisConfig RedisConfig `toml:"redis"`
}

type SlackConfig

type SlackConfig struct {
	Token      string `toml:"token"`
	ChannelIDs string `toml:"channel-ids"`
}

Jump to

Keyboard shortcuts

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