Documentation
¶
Overview ¶
Package schema provides a code-generated, zero-reflection schema for the magus Config struct. Every config-backed CLI flag and MAGUS_* env var is available in Fields for O(1) lookup. Regenerate with: cd magus && go generate ./cmd/magus/...
Index ¶
Constants ¶
const EnvPrefix = "MAGUS"
EnvPrefix is the prefix shared by every env var in Fields.
Variables ¶
var Fields []Field
Fields is the precomputed inventory of every config-backed CLI flag and MAGUS_* env var.
Functions ¶
func ParseBool ¶
ParseBool parses a boolean environment variable value using a case-insensitive comparison. "true", "1", "yes" → true; "false", "0", "no" → false. Any unrecognized value returns fallback unchanged.
func UseEnv ¶
UseEnv returns a fig.Option for schema's env scheme (equivalent to fig.UseEnv(EnvPrefix)).
Types ¶
type Field ¶
Field aliases fieldtype.Field: one scalar config field exposed as a flag and/or env var.
func FieldByEnv ¶
FieldByEnv returns the Field for the given MAGUS_* env-var name. Returns false if the name is not a known config-backed env var.
type Kind ¶
Kind aliases fieldtype.Kind: the scalar kind of a config field.
const ( KindString Kind = fieldtype.KindString KindInt Kind = fieldtype.KindInt KindBool Kind = fieldtype.KindBool KindFloat64 Kind = fieldtype.KindFloat64 KindBoolPtr Kind = fieldtype.KindBoolPtr KindDuration Kind = fieldtype.KindDuration KindStringSlice Kind = fieldtype.KindStringSlice )
The Kind constants mirror fieldtype's scalar config-field kinds.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package fieldtype holds the hand-written config-field types (Kind, Field, FlagNames) that the generated inventory in schema/gen populates.
|
Package fieldtype holds the hand-written config-field types (Kind, Field, FlagNames) that the generated inventory in schema/gen populates. |
|
Code generated by magus-utils config; DO NOT EDIT.
|
Code generated by magus-utils config; DO NOT EDIT. |