config

package
v0.0.0-...-e6b51b8 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config provides shared environment variable helpers.

Index

Constants

This section is empty.

Variables

View Source
var ErrRequiredEnvNotSet = errors.New("required environment variable is not set")

Functions

func EnvOr

func EnvOr(key, fallback string) string

EnvOr returns the environment variable value or a fallback default.

func EnvOrInt

func EnvOrInt(key string, fallback int) int

EnvOrInt returns an integer environment variable or a fallback default. Logs a warning if the value is set but not parseable or not positive.

func PostgresDSN

func PostgresDSN() string

PostgresDSN builds a Postgres connection string from standard env vars. Defaults sslmode to "require"; allows "disable" for local dev but logs a warning.

func RequireEnv

func RequireEnv(key string) (string, error)

RequireEnv returns the value of an env var or a typed error when it is missing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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