config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 6 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 {
	Server   ServerConfig
	Database DatabaseConfig
	Log      LogConfig
}

func Load

func Load() (Config, error)

type DatabaseConfig

type DatabaseConfig struct {
	Host           string `koanf:"host"`
	Port           int    `koanf:"port"`
	User           string `koanf:"user"`
	Password       string `koanf:"password"`
	Name           string `koanf:"name"`
	SSLMode        string `koanf:"sslmode"`
	MigrationsPath string `koanf:"migrations_path"`
}

func (DatabaseConfig) DSN

func (d DatabaseConfig) DSN() string

type LogConfig

type LogConfig struct {
	Level string `koanf:"level"`
}

type ServerConfig

type ServerConfig struct {
	Port            int           `koanf:"port"`
	ReadTimeout     time.Duration `koanf:"read_timeout"`
	WriteTimeout    time.Duration `koanf:"write_timeout"`
	ShutdownTimeout time.Duration `koanf:"shutdown_timeout"`
}

Jump to

Keyboard shortcuts

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