envutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package envutil parses process environment variables with the canonical, fail-closed rules shared by the Orka binaries. Blank values always yield the fallback; malformed values are reported to the caller, which decides whether to exit or degrade.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(name string) (bool, error)

Bool parses name with strconv.ParseBool; blank is false.

func Duration

func Duration(name string, fallback time.Duration) (time.Duration, error)

Duration parses name with time.ParseDuration.

func Int

func Int(name string, fallback int) (int, error)

Int parses name as a canonical base-10 platform-sized integer. Non-canonical spellings such as a leading "+" or zero padding are rejected.

func Int64

func Int64(name string, fallback int64) (int64, error)

Int64 parses name as a canonical base-10 64-bit integer.

func MustDuration

func MustDuration(name string, fallback time.Duration) time.Duration

MustDuration is Duration for process startup: a malformed value exits the process with "invalid NAME".

func MustInt

func MustInt(name string, fallback int) int

MustInt is Int for process startup: a malformed value exits the process with "invalid NAME".

func MustInt64

func MustInt64(name string, fallback int64) int64

MustInt64 is Int64 for process startup: a malformed value exits the process with "invalid NAME".

func MustPositiveInt

func MustPositiveInt(name string, fallback int) int

MustPositiveInt is Int for process startup: a malformed or non-positive value exits the process with "invalid NAME".

func String

func String(name, fallback string) string

String returns the trimmed value of name, or fallback when it is unset or blank.

Types

This section is empty.

Jump to

Keyboard shortcuts

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