config

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 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 App

type App struct {
	Name        string `env:"APP_NAME,default=hypernova-bot"`
	Environment string `env:"APP_ENVIRONMENT,default=local"`
}

App defines the configs needed for the application itself.

type Config

type Config struct {
	App
	Metrics
	Discord
}

Config is the aggregation of all necessary configurations.

func New

func New() (*Config, error)

type Discord

type Discord struct {
	Token string `env:"DISCORD_BOT_TOKEN,required"`
}

Discord defines the configs needed for interacting with the discord API.

type Metrics

type Metrics struct {
	Enabled bool   `env:"METRICS_ENABLED,default=false"`
	Addr    string `env:"METRICS_ADDRESS"`
	BufLen  int    `env:"METRICS_BUFFER,default=5"`
}

Metrics defines the configs needed for collecting metrics.

Jump to

Keyboard shortcuts

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