config

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: Apache-2.0 Imports: 1 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 {
	Addr           string `env:"API_ADDR"`         // host:port|:port
	DatabaseURL    string `env:"DATABASE_URL"`     // required
	LogLevel       string `env:"LOG_LEVEL"`        // debug|info|warn|error
	MigrateOnStart bool   `env:"MIGRATE_ON_START"` // true|false
	MigrationsDir  string `env:"MIGRATIONS_DIR"`   // plain - means use embedded
	Env            string `env:"ENV"`              // development|staging|production

	// Optional rate-limit bypass for test/dev environments.
	RateLimitSkipEnabled bool   `env:"RATE_LIMIT_SKIP_ENABLED"` // true|false
	RateLimitSkipHeader  string `env:"RATE_LIMIT_SKIP_HEADER"`  // header name
}

func MustLoadFromEnv

func MustLoadFromEnv() Config

MustLoadFromEnv loads config or panics if required values are missing.

Jump to

Keyboard shortcuts

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