package
Version:
v0.0.0-...-55babe7
Opens a new window with list of versions in this module.
Published: Jul 3, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
type Config struct {
Version string `env:"VERSION" envDefault:"UNDEFINED"`
HashSecret string `env:"HASH_SECRET,required"`
HTTPPort int `env:"HTTP_PORT" envDefault:"8000"`
Database Database `envPrefix:"DB_"`
Redis Redis `envPrefix:"REDIS_"`
}
New builds a configuration struct that will be used by the application.
It will be available to all of the application's dependencies.
type Database struct {
User string `env:"USER" envDefault:"postgres"`
Password string `env:"PASSWORD"`
Name string `env:"NAME" envDefault:"fedits"`
Host string `env:"HOST" envDefault:"localhost"`
Port int `env:"PORT" envDefault:"5432"`
SSLMode string `env:"SSL_MODE"`
TimeZone string `env:"TIME_ZONE" envDefault:"America/Sao_Paulo"`
}
type Redis struct {
Addr string `env:"ADDR" envDefault:"localhost:6379"`
Username string `env:"USERNAME"`
Password string `env:"PASSWORD"`
DB int `env:"DB" envDefault:"0"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.