validator

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JsonValidator

type JsonValidator struct{}

func (JsonValidator) Validate

func (jv JsonValidator) Validate(b []byte) (bool, error)

Validate implements the Validator interface by attempting to unmarshall a byte array of json

type TomlValidator added in v1.1.0

type TomlValidator struct{}

func (TomlValidator) Validate added in v1.1.0

func (tv TomlValidator) Validate(b []byte) (bool, error)

type Validator

type Validator interface {
	Validate(b []byte) (bool, error)
}

Validate accepts a byte array of a file or string to be validated and returns true or false if the content of the byte array is valid or not. If it is not valid, the error return value will be populated.

type XmlValidator

type XmlValidator struct{}

func (XmlValidator) Validate

func (xv XmlValidator) Validate(b []byte) (bool, error)

Validate implements the Validator interface by attempting to unmarshall a byte array of xml

type YamlValidator

type YamlValidator struct{}

func (YamlValidator) Validate

func (yv YamlValidator) Validate(b []byte) (bool, error)

Validate implements the Validator interface by attempting to unmarshall a byte array of yaml

Jump to

Keyboard shortcuts

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