config

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package config loads framework configuration from environment variables and .env files. It deliberately does not depend on viper or other heavy configuration libraries — applications often need full control over their configuration source, and lagodev only requires a handful of values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(key string, fallback bool) bool

Bool parses a boolean env value.

func Duration

func Duration(key string, fallback time.Duration) time.Duration

Duration parses a Go-formatted duration value or returns fallback.

func FromEnv

func FromEnv() database.Config

FromEnv constructs a database.Config from environment variables.

DB_CONNECTION (driver), DB_HOST, DB_PORT, DB_USERNAME, DB_PASSWORD,
DB_DATABASE, DB_SCHEMA, DB_SSL_MODE, DB_TIMEZONE, DB_LOG_QUERIES,
DB_SLOW_QUERY, DB_MAX_OPEN, DB_MAX_IDLE.

Useful for 12-factor apps that prefer env-driven config.

func Int

func Int(key string, fallback int) int

Int parses an integer env value or returns fallback.

func LoadEnv

func LoadEnv(files ...string) error

LoadEnv loads variables from one or more .env files into the process environment. Missing files are silently ignored.

func String

func String(key, fallback string) string

String returns the env value or fallback.

Types

This section is empty.

Jump to

Keyboard shortcuts

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