config

package
v0.0.0-...-a36e7e9 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 8 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 {
	Database DatabaseConfig `yaml:"database"`
	HTTP     HTTPConfig     `yaml:"http"`
	Logging  LoggerConfig   `yaml:"logging"`
	JWT      JWTConfig      `yaml:"jwt"`
	Email    EmailConfig    `yaml:"email"`
}

Config struct holds the application configuration

func Load

func Load() (*Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host            string        `yaml:"host"`
	Port            int           `yaml:"port"`
	User            string        `yaml:"user"`
	Password        string        `yaml:"password"`
	DBName          string        `yaml:"dbname"`
	SSLMode         string        `yaml:"sslmode"`
	MaxIdleConns    int           `yaml:"max_idle_conns"`
	MaxOpenConns    int           `yaml:"max_open_conns"`
	ConnMaxLifetime time.Duration `yaml:"conn_max_life_time"`
}

type EmailConfig

type EmailConfig struct {
	SMTPServer string `yaml:"smtp_server"`
	SMTPPort   string `yaml:"smtp_port"`
	SMTPUser   string `yaml:"smtp_user"`
	SMTPPass   string `yaml:"smtp_pass"`
	FromEmail  string `yaml:"from_email"`
}

type HTTPConfig

type HTTPConfig struct {
	Host string `yaml:"host"`
	Port int    `yaml:"port"`
}

type JWTConfig

type JWTConfig struct {
	SecretKey     string `yaml:"secret_key"`
	ExpireMinutes int    `yaml:"expire_minutes"`
}

type LoggerConfig

type LoggerConfig struct {
	FilePath string `yaml:"filePath"`
	Encoding string `yaml:"encoding"`
	Level    string `yaml:"level"`
	Logger   string `yaml:"logger"`
}

Jump to

Keyboard shortcuts

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