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 ¶
const ( LogStderr = "ANFRA_LOG_STDERR" SidecarStdout = "ANFRA_SIDECAR_STDOUT" NoUpdateNotifier = "ANFRA_NO_UPDATE_NOTIFIER" AutoUpdate = "ANFRA_AUTO_UPDATE" HideErrorCauses = "ANFRA_HIDE_ERROR_CAUSES" NoAppLogs = "ANFRA_NO_APP_LOGS" )
The switches. Each is off by default, but LogStderr, which is on for `anfra serve` (OnOr).
Variables ¶
This section is empty.
Functions ¶
func On ¶
On reports whether the switch is on: 1. Unset, empty, 0, or (after Validate has refused it) any other value is off.
Types ¶
type InvalidError ¶ added in v0.13.4
type InvalidError struct {
Name string // the variable, ANFRA_LOG_STDERR
Value string // what it is set to
}
InvalidError is a switch set to something other than 1 or 0.
func (*InvalidError) Error ¶ added in v0.13.4
func (e *InvalidError) Error() string