config

package
v0.0.0-...-e4064bc Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: MIT Imports: 2 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 {
	// DatabaseURL is a connection string to the database.
	DatabaseURL string `mapstructure:"DATABASE_URL"`
	// HTTPServerListenAddress is an address on which the HTTP server will listen.
	HTTPServerListenAddress string `mapstructure:"HTTP_SERVER_LISTEN_ADDRESS"`
	// TokenSecret is a secret used to sign JWT tokens.
	TokenSecret string `mapstructure:"TOKEN_SECRET"`
	// TokenDuration is a duration for which the JWT token is valid.
	TokenDuration time.Duration `mapstructure:"TOKEN_DURATION"`
}

Config stores all configuration of the application. The values are read by viper from a config file or envirionment variables.

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads configuration from file or environment variables. Config values specified in the config file are overwritten with environment variables if set.

Jump to

Keyboard shortcuts

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