config

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2024 License: MIT Imports: 5 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 {
	BuildVersion      string        `mapstructure:"VERSION"`
	AppEnv            string        `mapstructure:"APP_ENV"`
	AppPort           int           `mapstructure:"APP_PORT"`
	Domain            string        `mapstructure:"DOMAIN"`
	DBType            string        `mapstructure:"DB_TYPE"`
	DBHost            string        `mapstructure:"DB_HOST"`
	DBPort            int           `mapstructure:"DB_PORT"`
	DBName            string        `mapstructure:"DB_NAME"`
	DBUser            string        `mapstructure:"DB_USER"`
	DBPassword        string        `mapstructure:"DB_PASSWORD"`
	DBSSLMode         string        `mapstructure:"DB_SSLMODE"`
	DBMaxIdleConns    int           `mapstructure:"DB_MAX_IDLE_CONNS"`
	DBMaxConnLifetime time.Duration `mapstructure:"DB_MAX_CONN_LIFETIME"`
	MaxConns          int           `mapstructure:"MAX_CONNS"`
	MinConns          int           `mapstructure:"MIN_CONNS"`
	Migrate           bool          `mapstructure:"MIGRATE"`
	Seed              bool          `mapstructure:"SEED"`
	RedisExp          int           `mapstructure:"REDIS_EXP"`
	RedisURI          string        `mapstructure:"REDIS_URI"`
	RedisPassword     string        `mapstructure:"REDIS_PASSWORD"`
	RedisDB           int           `mapstructure:"REDIS_DB"`
	IsRedis           bool          `mapstructure:"IS_REDIS"`
	RateLimitEnabled  bool          `mapstructure:"RATE_LIMIT_ENABLED"`
	RateLimit         int           `mapstructure:"RATE_LIMIT"`
	RateLimitDuration time.Duration `mapstructure:"RATE_LIMIT_DURATION"`
	JwtSecretKey      string        `mapstructure:"JWT_SECRET_KEY"`
	JwtExpiration     time.Duration `mapstructure:"JWT_EXPIRATION"`
	StorageDisk       string        `mapstructure:"STORAGE_DISK"`
	StoragePath       string        `mapstructure:"STORAGE_PATH"`
	AwsRegion         string        `mapstructure:"AWS_REGION"`
	AwsAccessKey      string        `mapstructure:"AWS_ACCESS_KEY"`
	AwsSecretKey      string        `mapstructure:"AWS_SECRET_KEY"`
	AwsBucket         string        `mapstructure:"AWS_BUCKET"`
	AwsEndpoint       string        `mapstructure:"AWS_ENDPOINT"`
	OtpExpiration     int           `mapstructure:"OTP_EXPIRATION"`
	OtpLength         int           `mapstructure:"OTP_LENGTH"`
	OtpResendDuration int           `mapstructure:"OTP_RESEND_DURATION"`
	ReadTimeout       int           `mapstructure:"READ_TIMEOUT"`
	WriteTimeout      int           `mapstructure:"WRITE_TIMEOUT"`
	IdleTimeout       int           `mapstructure:"IDLE_TIMEOUT"`
	MaxHeaderBytes    int           `mapstructure:"MAX_HEADER_BYTES"`
}
var (
	GlobalConfig *Config
)

func GetConfig added in v1.4.4

func GetConfig() *Config

func LoadConfig

func LoadConfig() (*Config, error)

LoadConfig loads the configuration from the environment and config file

Jump to

Keyboard shortcuts

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