validation

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StrictlyRequired = strictlyRequiredRule{}

Functions

func NotEqual

func NotEqual(value string) validation.Rule

func NotStartWith

func NotStartWith(prefix string) validation.Rule

func OneOf

func OneOf(allowed ...any) validation.Rule

func OneOfOrderBy

func OneOfOrderBy(orderBys ...string) validation.Rule

Types

type DecoderValidator

type DecoderValidator struct{}

func NewDefaultDecoderValidator

func NewDefaultDecoderValidator() DecoderValidator

func (DecoderValidator) DecodeAndValidateJSONPayload

func (dv DecoderValidator) DecodeAndValidateJSONPayload(r *http.Request, object any) error

func (DecoderValidator) DecodeAndValidateURLValues

func (dv DecoderValidator) DecodeAndValidateURLValues(r *http.Request, object KeyedPayload) error

func (DecoderValidator) DecodeAndValidateYAMLPayload

func (dv DecoderValidator) DecodeAndValidateYAMLPayload(r *http.Request, object any) error

type IgnoredKeysPayload

type IgnoredKeysPayload interface {
	IgnoredKeys() []*regexp.Regexp
}

type KeyedPayload

type KeyedPayload interface {
	SupportedKeys() []string
	DecodeFromURLValues(url.Values) error
}

Jump to

Keyboard shortcuts

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