envflag

package
v0.13.2 Latest Latest
Warning

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

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

Documentation

Overview

Package envflag reads anfra's on/off environment variables. Each is 1 (on) or 0 (off); unset or empty means its default, and any other value is refused, at startup, so a typo surfaces at once rather than silently meaning the opposite.

Only anfra's own switches follow this rule. Standard variables keep their own conventions: CI (set by CI systems, to anything), OTEL_SDK_DISABLED (OpenTelemetry's, "true").

Index

Constants

View Source
const (
	LogStderr        = "ANFRA_LOG_STDERR"
	SidecarStdout    = "ANFRA_SIDECAR_STDOUT"
	NoUpdateNotifier = "ANFRA_NO_UPDATE_NOTIFIER"
	AutoUpdate       = "ANFRA_AUTO_UPDATE"
	HideErrorCauses  = "ANFRA_HIDE_ERROR_CAUSES"
)

The switches, each off by default.

Variables

This section is empty.

Functions

func On

func On(name string) bool

On reports whether the switch is on: 1. Unset, empty, 0, or (after Validate has refused it) any other value is off.

func Validate

func Validate() error

Validate refuses a switch set to anything but 1 or 0, naming it and the value it has. Call it once, before anything reads a switch.

Types

This section is empty.

Jump to

Keyboard shortcuts

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