validate

package
Version: v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2015 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Enum

func Enum(path, in string, data interface{}, enum interface{}) *errors.Validation

Enum validates if the data is a member of the enum

func FormatOf

func FormatOf(path, in, format, data string, registry strfmt.Registry) *errors.Validation

FormatOf validates if a string matches a format in the format registry

func MaxItems

func MaxItems(path, in string, size, max int64) *errors.Validation

MaxItems validates that there are at most n items in a slice

func MaxLength

func MaxLength(path, in, data string, maxLength int64) *errors.Validation

MaxLength validates a string for maximum length

func Maximum

func Maximum(path, in string, data, max float64, exclusive bool) *errors.Validation

Maximum validates if a number is smaller than a given maximum

func MinItems

func MinItems(path, in string, size, min int64) *errors.Validation

MinItems validates that there are at least n items in a slice

func MinLength

func MinLength(path, in, data string, minLength int64) *errors.Validation

MinLength validates a string for minimum length

func Minimum

func Minimum(path, in string, data, min float64, exclusive bool) *errors.Validation

Minimum validates if a number is smaller than a given minimum

func MultipleOf

func MultipleOf(path, in string, data, factor float64) *errors.Validation

MultipleOf validates if the provided number is a multiple of the factor

func Pattern

func Pattern(path, in, data, pattern string) *errors.Validation

Pattern validates a string against a regular expression

func Required

func Required(path, in string, data interface{}) *errors.Validation

Required validates an interface for requiredness

func RequiredNumber

func RequiredNumber(path, in string, data float64) *errors.Validation

RequiredNumber validates a number for requiredness

func RequiredString

func RequiredString(path, in, data string) *errors.Validation

RequiredString validates a string for requiredness

func UniqueItems

func UniqueItems(path, in string, data interface{}) *errors.Validation

UniqueItems validates that the provided slice has unique elements

Types

This section is empty.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL