Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldInfo ¶
type FieldInfo struct {
Name string
Type reflect.Type
Tag *TagSpec
Index []int // Field index path for embedded structs
IsEmbedded bool
FieldName string // Original struct field name
}
FieldInfo holds information about a struct field
type StructInfo ¶
type StructInfo struct {
Fields []FieldInfo
}
StructInfo holds metadata about a struct
func ParseStruct ¶
func ParseStruct(t reflect.Type) (*StructInfo, error)
ParseStruct extracts all fields with conform tags
type TagSpec ¶
type TagSpec struct {
// Source configuration
EnvVar string // Environment variable name
FileKey string // Key in config file (for nested configs)
Default string // Default value if not found
Required bool // Is this field required?
Prefix string // Prefix for nested structs (e.g. "DB_")
// Type conversion
Separator string // For slices: "1,2,3" with separator ","
Format string // For time.Time: "2006-01-02"
// Validation rules
Validators []Validator
}
TagSpec represents parsed tag information
Click to show internal directories.
Click to hide internal directories.