extensions

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ValidatorExtension

type ValidatorExtension struct {
	*validator.FieldValidator
	// contains filtered or unexported fields
}

ValidatorExtension contains the rules set by the (validator.field) method option extension.

func (ValidatorExtension) MarshalJSON

func (v ValidatorExtension) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (ValidatorExtension) Rules

func (v ValidatorExtension) Rules() []ValidatorRule

Rules returns all active rules

type ValidatorRule

type ValidatorRule struct {
	Name  string      `json:"name"`
	Value interface{} `json:"value"`
}

ValidatorRule represents a single validator rule from the (validator.field) method option extension.

Jump to

Keyboard shortcuts

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