Documentation
¶
Overview ¶
Package validator provides .env file validation against schemas and code usage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasWarnings ¶
HasWarnings returns true if any result is a warning.
Types ¶
type Result ¶
type Result struct {
Severity Severity `json:"severity"`
Key string `json:"key"`
Message string `json:"message"`
}
Result represents a single validation finding.
func ValidateAgainstCode ¶
func ValidateAgainstCode(vars []envfile.EnvVar, refs []scanner.EnvReference) []Result
ValidateAgainstCode validates env vars against code references.
type Schema ¶
type Schema struct {
Entries []SchemaEntry
}
Schema represents a parsed .env.schema file.
func ParseSchema ¶
ParseSchema reads and parses a .env.schema file.
func ParseSchemaString ¶
ParseSchemaString parses a schema from a string.
type SchemaEntry ¶
type SchemaEntry struct {
Key string
Type string
Required bool
Default string
Constraints map[string]string
}
SchemaEntry represents a single entry in the .env.schema file.
type Severity ¶
type Severity string
Severity represents the severity of a validation result.
const ( // SeverityError indicates a required variable is missing or invalid. SeverityError Severity = "error" // SeverityWarning indicates a potential issue (e.g., unused variable). SeverityWarning Severity = "warning" // SeverityInfo indicates informational messages. SeverityInfo Severity = "info" )
Click to show internal directories.
Click to hide internal directories.