config

package
v0.0.0-...-5dd7220 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	Discord: DiscordConfig{
		Token:      "",
		OwnerID:    "",
		GuildLimit: -1,
	},
	Logrus: LogrusConfig{
		Level:  "info",
		Colors: true,
	},
	Database: DatabaseConfig{
		Type: "postgres",
		DBCreds: DBCreds{
			Host: "localhost",
			Port: 5432,
		},
	},
	Waterlink: WaterlinkConfig{
		Host:     "",
		Password: "",
	},
}

Functions

func Opt

func Opt[T comparable](v []T, def ...T) T

func Parse

func Parse[T comparable](cfgFile string, envPrefix string, def ...T) (cfg T, err error)

Types

type Config

type Config struct {
	Discord   DiscordConfig
	Logrus    LogrusConfig
	Database  DatabaseConfig
	Waterlink WaterlinkConfig
}

type DBCreds

type DBCreds struct {
	Host     string
	Port     int
	Database string
	Username string
	Password string
}

type DatabaseConfig

type DatabaseConfig struct {
	Type    string
	DBCreds DBCreds
}

type DiscordConfig

type DiscordConfig struct {
	Token      string
	OwnerID    string
	GuildLimit int
}

type LogrusConfig

type LogrusConfig struct {
	Level  string
	Colors bool
}

type PlayerConfig

type PlayerConfig struct {
	FastTriggerTime time.Duration

	Lavalink WaterlinkConfig
}

type WaterlinkConfig

type WaterlinkConfig struct {
	Host     string
	Password string
}

Jump to

Keyboard shortcuts

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