env

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package env provides environment variable helpers that support OPENAUDIO_-prefixed canonical names with fallback to legacy names.

Convention: always pass the OPENAUDIO_ key first, then any legacy key(s). The first key that is set wins; if none are set, the default is returned.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(keys ...string) bool

Bool returns true if the first set environment variable equals "true".

func Get

func Get(defaultValue string, keys ...string) string

Get returns the value of the first set environment variable from keys, or defaultValue if none are set.

func GetDuration

func GetDuration(defaultValue time.Duration, keys ...string) time.Duration

GetDuration returns the duration value of the first set environment variable. If the value cannot be parsed, defaultValue is returned.

func GetInt

func GetInt(defaultValue int, keys ...string) int

GetInt returns the integer value of the first set environment variable. If the value cannot be parsed, defaultValue is returned.

func IsSet

func IsSet(keys ...string) bool

IsSet returns true if any of the given keys is set.

func Lookup

func Lookup(keys ...string) (string, bool)

Lookup returns the value of the first set environment variable. Returns ("", false) if none of the keys are set.

func String

func String(keys ...string) string

String returns the value of the first set environment variable from keys, or "" if none are set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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