datatype

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package datatype holds utilities for working with different data formats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsJSON

func IsJSON(bytes []byte) error

IsJSON checks whether bytes are in JSON format.

Types

type JSONSchemaRawValidator added in v0.9.1

type JSONSchemaRawValidator struct{}

JSONSchemaRawValidator is entity that has ability to validate data against JSON schema passed as string

func NewJSONSchemaRawValidator added in v0.9.1

func NewJSONSchemaRawValidator() JSONSchemaRawValidator

func (JSONSchemaRawValidator) Validate added in v0.9.1

func (J JSONSchemaRawValidator) Validate(document, jsonSchema string) error

Validate validates document against jsonSchema

type JSONSchemaReferenceValidator added in v0.9.1

type JSONSchemaReferenceValidator struct {
	// contains filtered or unexported fields
}

JSONSchemaReferenceValidator is entity that has ability to validate data against JSON schema passed as reference.

func NewDefaultJSONSchemaReferenceValidator added in v0.9.1

func NewDefaultJSONSchemaReferenceValidator(schemasDir string) JSONSchemaReferenceValidator

func NewJSONSchemaReferenceValidator added in v0.9.1

func NewJSONSchemaReferenceValidator(schemasDir string, fileValidator v.Validator, urlValidator v.Validator) JSONSchemaReferenceValidator

func (JSONSchemaReferenceValidator) Validate added in v0.9.1

func (jsv JSONSchemaReferenceValidator) Validate(document, schemaPath string) error

Validate validates document against JSON schema located in schemaPath. schemaPath may be URL or relative/full path to json schema on user OS

Jump to

Keyboard shortcuts

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