config

package
v0.0.0-...-53711f0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: MIT Imports: 4 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 {
	Version string `yaml:"version" env-default:"v0.1.0"`
}

type Config

type Config struct {
	Env        string `yaml:"env" env-default:"development"`
	ApiConfig  `yaml:"api_config"`
	HTTPServer `yaml:"http_server"`
	DBConfig   `yaml:"db_config"`
}

func MustLoad

func MustLoad() *Config

type DBConfig

type DBConfig struct {
	Host     string `yaml:"host" env-default:"127.0.0.1"`
	Port     string `yaml:"port" env-default:"3306"`
	Database string `yaml:"database" env-default:"apiwalk"`
	Username string `yaml:"username" env-default:"root"`
	Password string `yaml:"password" env-default:""`
}

type HTTPServer

type HTTPServer struct {
	Host        string        `yaml:"host" env-default:"127.0.0.1"`
	Port        string        `yaml:"port" env-default:"8080"`
	Timeout     time.Duration `yaml:"timeout" env-default:"5s"`
	IdleTimeout time.Duration `yaml:"idle_timeout" env-default:"60s"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳