configuration

package
v0.0.0-...-5927a11 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 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 APIConfig

type APIConfig struct {
	Port string `envconfig:"API_PORT" default:":8000"`
}

type Config

type Config struct {
	API      APIConfig
	Postgres PostgresConfig
	TokenKey string `envconfig:"ACCESS_SECRET" required:"true"`
	LogLevel string `envconfig:"LOG_LEVEL"`
}

func LoadConfig

func LoadConfig() (*Config, error)

type PostgresConfig

type PostgresConfig struct {
	DatabaseName string `envconfig:"DB_NAME" default:"transfer-me"`
	User         string `envconfig:"DB_USER" default:"postgres"`
	Password     string `envconfig:"DB_PASS" default:"postgres"`
	Host         string `envconfig:"DB_HOST" default:"127.0.0.1"`
	Port         string `envconfig:"DB_PORT" default:"5432"`
	SSLMode      string `envconfig:"DB_SSLMODE" default:"disable"`
}

func (PostgresConfig) DSN

func (p PostgresConfig) DSN() string

func (PostgresConfig) URL

func (p PostgresConfig) URL() string

Jump to

Keyboard shortcuts

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