config

package
v0.0.0-...-a186ec8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorConfigFlagEmpty   error = errors.New("config flag is not passed")
	ErrorConfigFileInvalid error = errors.New("config file has invalid format")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Env        EnvType    `yaml:"env" env-required:"true"`
	HttpServer HttpServer `yaml:"http_server" env-required:"true"`
	Storage    Storage    `yaml:"storage" env-required:"true"`
}

func Load

func Load() (*Config, error)

type EnvType

type EnvType string
const (
	EnvLocal EnvType = "local"
	EnvDev   EnvType = "dev"
)

type HttpServer

type HttpServer struct {
	Port string `yaml:"port" env-required:"true"`
}

type Storage

type Storage struct {
	Host         string `yaml:"host" env-required:"true"`
	Port         string `yaml:"port" env-required:"true"`
	DatabaseName string `yaml:"database_name" env-required:"true"`
	User         string `yaml:"user" env-required:"true"`
	Password     string `yaml:"password" env-required:"true"`
}

Jump to

Keyboard shortcuts

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