config

package
v0.0.0-...-ac0e98d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package config provides a configuration setup needed to run the app.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	TokenSymmetricKey    string        `mapstructure:"TOKEN_SYMMETRIC_KEY"`
	AccessTokenDuration  time.Duration `mapstructure:"ACCESS_TOKEN_DURATION"`
	RefreshTokenDuration time.Duration `mapstructure:"REFRESH_TOKEN_DURATION"`
}

type Config

type Config struct {
	DB                `mapstructure:",squash"`
	Auth              `mapstructure:",squash"`
	Mailer            `mapstructure:",squash"`
	RedisHost         string `mapstructure:"REDIS_HOST"`
	MigrationURL      string `mapstructure:"MIGRATION_URL"`
	DatabaseURL       string `mapstructure:"DATABASE_URL"`
	HTTPServerAddress string `mapstructure:"HTTP_SERVER_ADDRESS"`
}

func Load

func Load(path string) (Config, error)

type DB

type DB struct {
	User         string `mapstructure:"DB_USER"`
	Password     string `mapstructure:"DB_PASSWORD"`
	Host         string `mapstructure:"DB_HOST"`
	Name         string `mapstructure:"DB_NAME"`
	MaxIdleConns int    `mapstructure:"MAX_IDLE_CONNS"`
	MaxOpenConns int    `mapstructure:"MAX_OPEN_CONNS"`
	DisableTLS   bool   `mapstructure:"DISABLE_TLS"`
}

type Mailer

type Mailer struct {
	MailerName    string `mapstructure:"MAILER_NAME"`
	EmailAddress  string `mapstructure:"MAILER_EMAIL_ADDRESS"`
	EmailPassword string `mapstructure:"MAILER_EMAIL_PASSWORD"`
}

Jump to

Keyboard shortcuts

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