validate

package
v0.27.0-dev.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Overview

Package validate contains Validator implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JSON

func JSON[Input any](schema []byte) func(_ context.Context, input any) error

JSON creates a JSON validator. If nil is passed as schema, the validator will try to read schema.json in the current directory. If that file does not exist, no validation will be performed.

Types

type JSONValidator

type JSONValidator[Input any] struct {
	// contains filtered or unexported fields
}

JSONValidator validates the input against a JSON schema.

func (JSONValidator[Input]) Validate

func (j JSONValidator[Input]) Validate(_ context.Context, input any) (retErr error)

Validate validates the input against a JSON schema.

Jump to

Keyboard shortcuts

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