envconfig

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package envconfig resolves OPENSTORAGE_* settings with one minor release of CODESTORAGE_* compatibility. Presence, not a nonempty value, selects the new name.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environ

func Environ() []string

Environ returns a child environment with canonical settings also exported under their legacy names. This keeps old hook binaries in shared caches working; an explicitly empty canonical setting must also clear any inherited old value.

func First

func First(names ...string) string

First returns the value of the first PRESENT name in an alias chain. An explicitly empty earlier name ends the scan instead of exposing a later alias.

func Getenv

func Getenv(name string) string

Getenv is the value-only form of LookupEnv, suitable for injected config readers.

func LookupEnv

func LookupEnv(name string) (string, bool)

LookupEnv is os.LookupEnv with a legacy fallback for OPENSTORAGE_* names. Other names pass through unchanged. Lookups never log: hooks and lazy runtime settings must not emit a warning on every read.

func Set

func Set(env []string, name, value string) []string

Set replaces both spellings with a trusted value. Exporting both lets older hook binaries use a new server's request context during rolling upgrades.

func Strip

func Strip(env []string, names ...string) []string

Strip removes both spellings of each canonical name from a child environment. It reuses env's backing array; callers must own that slice.

func WarnDeprecated

func WarnDeprecated(warn func(string, ...any))

WarnDeprecated reports legacy settings once at server startup, including knobs first read lazily after startup. Only names are logged, never environment values. Do not call this in hook subprocesses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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