config

package
v0.0.0-...-4c047f0 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvLocal = "local"
	Prod     = "prod"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AUTHConfig

type AUTHConfig struct {
	JWT                    JWTConfig
	PasswordSalt           string
	VerificationCodeLength int `mapstructure:"verificationCodeLength"`
}

type Config

type Config struct {
	Env  string `yaml:"env" env-default:"local"`
	AUTH AUTHConfig
	HTTP HTTPConfig
	PG   PGConfig
	SMTP SMTPConfig
}

func MustLoad

func MustLoad(cfgPath string) (*Config, error)

type HTTPConfig

type HTTPConfig struct {
	Host    string
	Port    string
	Timeout time.Duration
}

type JWTConfig

type JWTConfig struct {
	AccessTokenTTL  time.Duration `mapstructure:"accessTokenTTL"`
	RefreshTokenTTL time.Duration `mapstructure:"refreshTokenTTL"`
	SigningKey      string
}

type PGConfig

type PGConfig struct {
	Host     string
	Port     string
	DBName   string
	Username string
	Password string
	SSLMode  string
}

type SMTPConfig

type SMTPConfig struct {
	Port int    `mapstructure:"port"`
	Host string `mapstructure:"host"`
	From string `mapstructure:"from"`
	Pass string
}

Jump to

Keyboard shortcuts

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