config

package
v0.0.0-...-12e9e95 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 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 AppConfig

type AppConfig struct {
	Name        string
	Version     string
	Scheme      string
	Host        string
	Environment string
}

AppConfig holds the configuration related to the application settings.

type Config

type Config struct {
	App      AppConfig
	Server   ServerConfig
	Database DatabaseConfig
	Security SecurityConfig
	Redis    RedisConfig
}

func LoadConfig

func LoadConfig(filename string) (Config, error)

LoadConfig loads the configuration from the specified filename.

func LoadConfigPath

func LoadConfigPath(path string) (Config, error)

LoadConfigPath loads the configuration from the specified path.

type DatabaseConfig

type DatabaseConfig struct {
	Host     string // The host address of the database.
	Port     string // The port number of the database.
	DBName   string // The name of the database.
	UserName string // The username for connecting to the database.
	Password string // The password for connecting to the database.
	Debug    bool   // The Debug for debugging when query executed.
}

DatabaseConfig holds the configuration for the database connection.

type JWTConfig

type JWTConfig struct {
	Key             string
	ExpiredInSecond int64
	Label           string
}

type RedisConfig

type RedisConfig struct {
	Addr     string
	Password string
}

type SecurityConfig

type SecurityConfig struct {
	JWT JWTConfig
}

type ServerConfig

type ServerConfig struct {
	Port     string // The port on which the server will listen.
	Debug    bool   // Indicates if debug mode is enabled.
	TimeZone string // The time zone setting for the server.
}

ServerConfig holds the configuration for the server settings.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳