config

package
v0.0.0-...-ee5fcd5 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Constants
	DB *gorm.DB
}

func New

func New() (config *Config, err error)

type Constants

type Constants struct {
	Environment            string        `mapstructure:"ENVIRONMENT"`
	DBHost                 string        `mapstructure:"POSTGRES_HOST"`
	DBPort                 string        `mapstructure:"POSTGRES_PORT"`
	DBUserName             string        `mapstructure:"POSTGRES_USER"`
	DBUserPassword         string        `mapstructure:"POSTGRES_PASSWORD"`
	DBName                 string        `mapstructure:"POSTGRES_DB"`
	ServerPort             string        `mapstructure:"SERVER_PORT"`
	ServerHost             string        `mapstructure:"SERVER_HOST"`
	AccessTokenPrivateKey  string        `mapstructure:"ACCESS_TOKEN_PRIVATE_KEY"`
	AccessTokenPublicKey   string        `mapstructure:"ACCESS_TOKEN_PUBLIC_KEY"`
	RefreshTokenPrivateKey string        `mapstructure:"REFRESH_TOKEN_PRIVATE_KEY"`
	RefreshTokenPublicKey  string        `mapstructure:"REFRESH_TOKEN_PUBLIC_KEY"`
	AccessTokenExpiresIn   time.Duration `mapstructure:"ACCESS_TOKEN_EXPIRED_IN"`
	RefreshTokenExpiresIn  time.Duration `mapstructure:"REFRESH_TOKEN_EXPIRED_IN"`
	AccessTokenMaxAge      int           `mapstructure:"ACCESS_TOKEN_MAXAGE"`
	RefreshTokenMaxAge     int           `mapstructure:"REFRESH_TOKEN_MAXAGE"`
	ValidationTranslator   ut.Translator
	Validate               *validator.Validate
}

func LoadEnvironmentVariables

func LoadEnvironmentVariables() (constants *Constants, err error)

Jump to

Keyboard shortcuts

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