config

package
v0.0.0-...-563d7cf Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2023 License: MIT Imports: 6 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 {
	// LogLevel is the level of logging to use.
	LogLevel string `default:"info" split_words:"true"`

	// DatabasePath is the path to a SQLite database file to use for data storage.
	DatabasePath string `default:"elf.sqlite" split_words:"true"`

	// DiscordToken is the token of the Discord bot to run as.
	DiscordToken string `required:"true" split_words:"true"`
	// DiscordAppID is the ID of the app owning the bot user.
	DiscordAppID string `required:"true" split_words:"true"`
	// DiscordGuildID is the ID of the guild to register commands on, for development.
	DiscordGuildID string `split_words:"true"`
	// AdventOfCodeSession is the session cookie for Advent of Code of the bot user to use for this bot instance.
	AdventOfCodeSession string `required:"true" split_words:"true"`

	// AdventOfCodeEvent is the event to fetch details from.
	AdventOfCodeEvent string `default:"2022" split_words:"true"`
	// UpdateSchedule is a cron schedule expression (in UTC) denoting when to update leaderboards
	UpdateSchedule string `default:"30 1,15 1-25 Dec *" split_words:"true"`

	// ApiBindAddr is the address the leaderboard API should listen on.
	ApiBindAddr string `default:":10000" split_words:"true"`
}

func Load

func Load() (Config, error)

Jump to

Keyboard shortcuts

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