config

package
v0.0.0-...-cb931d6 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 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 {
	Env        string     `yaml:"env" env-required:"true"`
	Postgres   Postgres   `yaml:"postgres" env-required:"true"`
	HTTPServer HTTPServer `yaml:"http_server" env-required:"true"`
}

func MustLoad

func MustLoad() *Config

type HTTPServer

type HTTPServer struct {
	Address     string        `yaml:"address" env-default:"localhost:8080"`
	Timeout     time.Duration `yaml:"timeout" env-default:"4s"`
	IdleTimeout time.Duration `yaml:"idleTimeout" env-default:"60s"`
	User        string        `yaml:"user" env-required:"true"`
	Password    string        `yaml:"password" env-required:"true" env:"HTTP_SERVER_PASSWORD"`
}

type Postgres

type Postgres struct {
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	User         string `yaml:"user"`
	Password     string `yaml:"user_password" env-required:"true" env:"POSTGRES_USER_PASSWORD"`
	DatabaseName string `yaml:"database_name"`
	DSNTemplate  string `yaml:"DSNTemplate"`
}

Jump to

Keyboard shortcuts

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