config

package
v0.0.0-...-0f1690e Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppDomain = "APP_DOMAIN"

	SMTPHost             = "SMTP_HOST"
	SMTPPort             = "SMTP_PORT"
	TechEmail            = "TECH_EMAIL"
	PasswordForTechEmail = "PASSWORD_FOR_TECH_EMAIL"

	DBUser     = "DB_USER"
	DBPassword = "DB_PASSWORD"
	DBHost     = "DB_HOST"
	DBPort     = "DB_PORT"
	DBName     = "DB_NAME"

	InMemoryStorageHost     = "IN_MEMORY_STORAGE_HOST"
	InMemoryStoragePort     = "IN_MEMORY_STORAGE_PORT"
	InMemoryStoragePassword = "IN_MEMORY_STORAGE_PASSWORD" //nolint:gosec
)

Variables

View Source
var ErrEmptyEnvVar = errors.New("empty environment variable")

Functions

func CheckEnvironmentVars

func CheckEnvironmentVars() error

Types

type AppConfig

type AppConfig struct {
	Domain string
}

type Config

type Config struct {
	AppConfig       AppConfig
	SMTP            SMTPConfig
	Database        DatabaseConfig
	InMemoryStorage InMemoryStorageConfig
}

func BuildFromEnv

func BuildFromEnv() Config

type DatabaseConfig

type DatabaseConfig struct {
	User     string
	Password string

	Host         string
	Port         string
	DatabaseName string
}

func (DatabaseConfig) ConnectionString

func (dbc DatabaseConfig) ConnectionString() string

type InMemoryStorageConfig

type InMemoryStorageConfig struct {
	Host     string
	Port     string
	Password string
}

type SMTPConfig

type SMTPConfig struct {
	Host string
	Port string

	Email    string
	Password string
}

Jump to

Keyboard shortcuts

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