validate

package
v1.0.0-beta.1.0...-bf02ba7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 7, 2024 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoLoader

func NewGoLoader(source interface{}) gojsonschema.JSONLoader

Types

type JsonSchemaValidator

type JsonSchemaValidator[T any] struct {
	// contains filtered or unexported fields
}

func (*JsonSchemaValidator[T]) IsValid

func (v *JsonSchemaValidator[T]) IsValid(object *T) error

type TagValidator

type TagValidator[T any] struct {
	// contains filtered or unexported fields
}

func NewTagValidator

func NewTagValidator[T any]() *TagValidator[T]

func (*TagValidator[T]) IsValid

func (v *TagValidator[T]) IsValid(object *T) error

func (*TagValidator[T]) SetValidationFunc

func (v *TagValidator[T]) SetValidationFunc(name string, callback validator.ValidationFunc) error

type Validator

type Validator[T any] interface {
	IsValid(*T) error
}

Validator is an interface for validating API responses. As Blizzard's API is not always consistent, this is necessary.

func NewSchemaValidator

func NewSchemaValidator[T any](jsonSchema string) (Validator[T], error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL