config

package
v0.0.0-...-e7d9688 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2023 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 App

type App struct {
	Name     string `env-required:"true" yaml:"name"    env:"APP_NAME"`
	Version  string `env-required:"true" yaml:"version" env:"APP_VERSION"`
	Debug    bool   `env-required:"true" yaml:"debug" env:"APP_DEBUG"`
	Email    string `env-required:"true" yaml:"email" env:"APP_EMAIL"`
	Password string `env-required:"true" yaml:"password" env:"APP_PASSWORD"`
}

App -.

type Config

type Config struct {
	App   `yaml:"app"`
	HTTP  `yaml:"http"`
	Log   `yaml:"logger"`
	DB    `yaml:"db"`
	Redis `yaml:"redis"`
}

Config -.

func NewConfig

func NewConfig() (*Config, error)

NewConfig returns app config.

type DB

type DB struct {
	DataDir string `env-required:"true" yaml:"dataDir" env:"DB_DATA_DIR"`
}

DB -.

type HTTP

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

HTTP -.

type Log

type Log struct {
	Level string `env-required:"true" yaml:"logLevel" env:"LOG_LEVEL"`
}

Log -.

type Redis

type Redis struct {
	URL      string `env-required:"true"                 env:"REDIS_DB_URL"`
	Password string `env-required:"true"                 env:"REDIS_DB_PASSWORD"`
	DB       int    `env-required:"true"                 env:"REDIS_DB"`
}

Redis -.

Jump to

Keyboard shortcuts

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