Documentation
¶
Index ¶
- func ListAvailableSchemas() ([]string, error)
- func ValidateJSON(schemaName string, data interface{}) error
- func ValidateStruct(schemaName string, structData interface{}) error
- func ValidateYAML(schemaName string, yamlContent []byte) error
- func ValidateYAMLFile(schemaName string, filePath string) error
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListAvailableSchemas ¶
ListAvailableSchemas returns a list of available schema filenames
func ValidateJSON ¶
ValidateJSON validates a data structure against an embedded JSON schema schemaName should be the filename of the schema (e.g., "stack-analyzer-config.json") data should be the parsed YAML/JSON data as interface{}
func ValidateStruct ¶
ValidateStruct validates a Go struct against an embedded JSON schema schemaName should be the filename of the schema (e.g., "stack-analyzer-config.json") structData should be the Go struct to validate
func ValidateYAML ¶
ValidateYAML validates YAML content against an embedded JSON schema schemaName should be the filename of the schema (e.g., "stack-analyzer-config.json") yamlContent should be the raw YAML content as bytes
func ValidateYAMLFile ¶
ValidateYAMLFile validates a YAML file against an embedded JSON schema schemaName should be the filename of the schema (e.g., "stack-analyzer-config.json") filePath should be the path to the YAML file to validate
Types ¶
type ValidationError ¶
type ValidationError struct {
Errors []string
}
ValidationError represents a schema validation error
func (ValidationError) Error ¶
func (e ValidationError) Error() string