config

package
v0.0.0-...-7a5cd37 Latest Latest
Warning

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

Go to latest
Published: May 7, 2024 License: MIT Imports: 5 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-default:"devel"`
	LogLevel   string `yaml:"log_level" env:"LOG_LEVEL" env-default:"INFO"`
	HTTPServer `yaml:"http_server"`
	DB         DB
}

func New

func New() *Config

func (Config) DbUrl

func (c Config) DbUrl() string

type DB

type DB struct {
	Host string `yaml:"db_host" env:"DB_HOST"`
	Port int    `yaml:"db_port" env:"DB_PORT"`
	Name string `yaml:"db_name" env:"DB_NAME"`
	User string `yaml:"db_user" env:"DB_USER"`
	Pass string `yaml:"db_pass" env:"DB_PASSWORD"`
}

type HTTPServer

type HTTPServer struct {
	Address     string        `yaml:"address" env:"API_ADDRESS" env-default:"localhost:8082"`
	Timeout     time.Duration `yaml:"timeout" env-default:"4s"`
	IdleTimeout time.Duration `yaml:"idle_timeout" env-default:"30s"`
}

Jump to

Keyboard shortcuts

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