config

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Load

func Load(dst any, paths ...string) error

LoadEnv loads environment variables from a .env file. If paths are omitted, it loads ".env" from the current working directory. Fills optional config if any

func LoadOptional added in v0.2.2

func LoadOptional(dst any) error

func ValidateDBConfig added in v0.8.1

func ValidateDBConfig(dbConfig DBConfig) error

Types

type AppConfig added in v0.8.2

type AppConfig struct {
	Name     string
	Env      string
	Timezone string
	Port     string
}

func LoadApp added in v0.8.2

func LoadApp() AppConfig

type CacheConfig added in v0.5.0

type CacheConfig struct {
	Host       string
	Port       string
	Password   string
	Username   string
	Prefix     string
	RetryCount int
}

Cache Config

func LoadCache added in v0.5.0

func LoadCache() CacheConfig

CacheConfigFromEnv reads cache settings from environment variables.

type DBConfig added in v0.8.0

type DBConfig struct {
	Host            string
	User            string
	Database        string
	Port            string
	Password        string
	MaxOpenConns    int
	MaxIdleConns    int
	ConnMaxLifetime time.Duration
	RetryCount      int
}

Common db config

type LoggerConfig

type LoggerConfig struct {
	LogLevel    string
	ServiceName string
	HandlerType string
}

Logger Config

func LoadLogger

func LoadLogger() LoggerConfig

type MySQLConfig

type MySQLConfig struct {
	DBConfig
}

MySQL Config

func LoadMySQL

func LoadMySQL() MySQLConfig

MySQLConfigFromEnv reads MySQL settings from environment variables.

type PostgreSQLConfig

type PostgreSQLConfig struct {
	DBConfig
	SSLMode string
}

Postgre Config

func LoadPostgreSQL

func LoadPostgreSQL() PostgreSQLConfig

PostgreSQLConfigFromEnv reads PostgreSQL settings from environment variables.

type SagaConfig added in v0.7.0

type SagaConfig struct {
	Host       string
	Namespace  string
	RetryCount int
}

Saga Config

func LoadSaga added in v0.7.0

func LoadSaga() SagaConfig

Jump to

Keyboard shortcuts

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