envvar

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package envvar reads typed configuration overrides from environment variables. sqi-server (internal/config) and sqi-worker (internal/worker/config) both overlay their settings through it, so the two binaries accept the same spellings and report a malformed variable in the same words.

It exists as a leaf because internal/config pulls internal/auth/oidc, so the worker binary can never import it. This package imports nothing internal.

Every setter treats an unset or empty variable as a no-op, so the lower config layer survives. The typed setters trim surrounding whitespace and return an error naming the variable and its value when it does not parse, never a silent fallback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(dst *bool, key string) error

Bool sets dst from a boolean variable spelled as ParseBool accepts. A malformed security-relevant flag such as SQI_AUTH_ENABLED=enabled is therefore an error rather than silently false.

func Duration

func Duration(dst *time.Duration, key string) error

Duration sets dst from a Go duration variable (e.g. "30s", "5m", "1h").

func Int

func Int(dst *int, key string) error

Int sets dst from an integer-valued variable.

func Int64

func Int64(dst *int64, key string) error

Int64 sets dst from an int64-valued variable.

func ParseBool

func ParseBool(s string) (value, ok bool)

ParseBool reads 1/true/yes/on as true and 0/false/no/off as false, in any case. ok is false for anything else, including surrounding whitespace.

func String

func String(dst *string, key string)

String sets dst from a string-valued variable, untrimmed.

func StringSlice

func StringSlice(dst *[]string, key string)

StringSlice sets dst from a comma-separated variable, trimming spaces and dropping empty entries. A variable holding only commas and blanks is a no-op like an unset one, so it cannot wipe a list the config file set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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