config

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config handles configuration via environment variables

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PostgresURI     string `env:"POSTGRES_URI,required" usage:"URI to MongoDB host. Example: postgresql://user:pass@localhost:5432/database"`
	APIRootURL      string `env:"API_URL,required" usage:"Root URL of Helldivers 2 API. Example: http://localhost:4000"`
	WorkerCron      string `` /* 157-byte string literal not displayed */
	HealthchecksURL string `env:"HEALTHCHECKS_URL" default:"" usage:"Root URL of healthchecks.io endpoint."`
}

Config contains configuration values

func Get

func Get() (*Config, error)

Get reads environment variables and parses them into a Config struct.

func MustGet added in v0.0.3

func MustGet() *Config

MustGet reads environment variables and parses them into a Config struct.

Any required environment variables which are not provided will cause the application to print usage and exit.

Jump to

Keyboard shortcuts

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