Documentation ¶
Index ¶
Constants ¶
View Source
const ( ErrorCodeInvalidURI = "invalid_schema_uri" ErrorCodeSchemaNotLoaded = "schema_not_loaded" ErrorCodeInvalidSchemaDef = "invalid_schema_definition" ErrorCodeInvalidData = "invalid_data" )
package constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶ added in v0.1.2
Error - non-schema validation errors
type Schema ¶
type Schema struct {
// contains filtered or unexported fields
}
Schema -
func NewSchema ¶
NewSchema - returns a new schema validator which loads and compiles the schema file supplied in the config
type ValidationError ¶ added in v0.1.2
type ValidationError struct { Type string Property string Value string Detail string Path string // contains filtered or unexported fields }
ValidationError - schema validation errors
func NewSchemaJSONError ¶
func NewSchemaJSONError(err gojsonschema.ResultError) ValidationError
NewSchemaJSONError - JSON schema validation errors
func NewValidationError ¶ added in v0.1.2
func NewValidationError(typ, property, value, detail, path string) ValidationError
NewValidationError -
func (ValidationError) Error ¶ added in v0.1.2
func (ve ValidationError) Error() string
Error - returns a formatted error string for the schema validation error
type ValidationErrorCollection ¶ added in v0.1.2
type ValidationErrorCollection []ValidationError
ValidationErrorCollection - collection of ValidationError types
func NewValidationErrorCollection ¶ added in v0.1.2
func NewValidationErrorCollection() ValidationErrorCollection
NewValidationErrorCollection - returns a collection of ValidationError types
func (*ValidationErrorCollection) Add ¶ added in v0.1.2
func (vec *ValidationErrorCollection) Add(ve ValidationError)
Add - add error to schema validation error collection
func (ValidationErrorCollection) Error ¶ added in v0.1.2
func (vec ValidationErrorCollection) Error() string
Error - returns a formatted error string from the schema validation error collection
Click to show internal directories.
Click to hide internal directories.