constraints

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: BSD-3-Clause Imports: 10 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArrayOptions added in v1.0.3

type ArrayOptions struct {
	Options []any
}

func (ArrayOptions) Validate added in v1.0.3

func (c ArrayOptions) Validate(value any) error

type ArrayRange added in v1.0.3

type ArrayRange struct {
	Min float64
	Max float64
}

func (ArrayRange) Validate added in v1.0.3

func (c ArrayRange) Validate(value any) error

type Blank

type Blank struct{}

func (Blank) Validate

func (c Blank) Validate(value any) error

type Composite added in v1.0.6

type Composite struct {
	Constraints []validator.Constraint
}

func (Composite) Validate added in v1.0.6

func (c Composite) Validate(value any) error

type Currency

type Currency struct{}

func (Currency) Validate

func (c Currency) Validate(value any) error

type Date added in v1.0.4

type Date struct {
	Min      time.Time
	Max      time.Time
	Format   string
	AllowNil bool
}

func (Date) Validate added in v1.0.4

func (c Date) Validate(value any) error

type Email

type Email struct{}

func (Email) Validate

func (c Email) Validate(value any) error

type EqualTo added in v1.0.5

type EqualTo struct {
	Value any
}

func (EqualTo) Validate added in v1.0.5

func (r EqualTo) Validate(value any) error

type Field added in v1.0.6

type Field struct {
	Constraints map[string]validator.Constraint
}

func (Field) Validate added in v1.0.6

func (n Field) Validate(value any) error

type GreaterOrEqual added in v1.0.5

type GreaterOrEqual struct {
	Value float64
}

func (GreaterOrEqual) Validate added in v1.0.5

func (r GreaterOrEqual) Validate(value any) error

type GreaterThen added in v1.0.5

type GreaterThen struct {
	Value float64
}

func (GreaterThen) Validate added in v1.0.5

func (r GreaterThen) Validate(value any) error

type IsBool

type IsBool struct{}

func (IsBool) Validate

func (c IsBool) Validate(value any) error

type IsFalse

type IsFalse struct{}

func (IsFalse) Validate

func (c IsFalse) Validate(value any) error

type IsFloat added in v1.0.2

type IsFloat struct{}

func (IsFloat) Validate added in v1.0.2

func (c IsFloat) Validate(value any) error

type IsFloat32 added in v1.0.2

type IsFloat32 struct{}

func (IsFloat32) Validate added in v1.0.2

func (c IsFloat32) Validate(value any) error

type IsFloat64 added in v1.0.2

type IsFloat64 struct{}

func (IsFloat64) Validate added in v1.0.2

func (c IsFloat64) Validate(value any) error

type IsInt added in v1.0.2

type IsInt struct{}

func (IsInt) Validate added in v1.0.2

func (c IsInt) Validate(value any) error

type IsInt8 added in v1.0.2

type IsInt8 struct{}

func (IsInt8) Validate added in v1.0.2

func (c IsInt8) Validate(value any) error

type IsInt16 added in v1.0.2

type IsInt16 struct{}

func (IsInt16) Validate added in v1.0.2

func (c IsInt16) Validate(value any) error

type IsInt32 added in v1.0.2

type IsInt32 struct{}

func (IsInt32) Validate added in v1.0.2

func (c IsInt32) Validate(value any) error

type IsInt64 added in v1.0.2

type IsInt64 struct{}

func (IsInt64) Validate added in v1.0.2

func (c IsInt64) Validate(value any) error

type IsString added in v1.0.2

type IsString struct{}

func (IsString) Validate added in v1.0.2

func (c IsString) Validate(value any) error

type IsStruct added in v1.0.2

type IsStruct struct{}

func (IsStruct) Validate added in v1.0.2

func (c IsStruct) Validate(value any) error

type IsTrue

type IsTrue struct{}

func (IsTrue) Validate

func (c IsTrue) Validate(value any) error

type IsUint added in v1.0.2

type IsUint struct{}

func (IsUint) Validate added in v1.0.2

func (c IsUint) Validate(value any) error

type IsUint8 added in v1.0.2

type IsUint8 struct{}

func (IsUint8) Validate added in v1.0.2

func (c IsUint8) Validate(value any) error

type IsUint16 added in v1.0.2

type IsUint16 struct{}

func (IsUint16) Validate added in v1.0.2

func (c IsUint16) Validate(value any) error

type IsUint32 added in v1.0.2

type IsUint32 struct{}

func (IsUint32) Validate added in v1.0.2

func (c IsUint32) Validate(value any) error

type IsUint64 added in v1.0.2

type IsUint64 struct{}

func (IsUint64) Validate added in v1.0.2

func (c IsUint64) Validate(value any) error

type Language

type Language struct{}

func (Language) Validate

func (c Language) Validate(value any) error

type LanguageWithRegion

type LanguageWithRegion struct{}

func (LanguageWithRegion) Validate

func (c LanguageWithRegion) Validate(value any) error

type Length added in v1.0.6

type Length struct {
	Min int
	Max int
}

func (Length) Validate added in v1.0.6

func (c Length) Validate(value any) error

type LessOrEqual added in v1.0.5

type LessOrEqual struct {
	Value float64
}

func (LessOrEqual) Validate added in v1.0.5

func (r LessOrEqual) Validate(value any) error

type LessThen added in v1.0.5

type LessThen struct {
	Value float64
}

func (LessThen) Validate added in v1.0.5

func (r LessThen) Validate(value any) error

type Nil added in v1.0.2

type Nil struct{}

func (Nil) Validate added in v1.0.2

func (c Nil) Validate(value any) error

type NotBlank

type NotBlank struct{}

func (NotBlank) Validate

func (c NotBlank) Validate(value any) error

type NotNil added in v1.0.2

type NotNil struct{}

func (NotNil) Validate added in v1.0.2

func (c NotNil) Validate(value any) error

type Options added in v1.0.3

type Options struct {
	Options []any
}

func (Options) Validate added in v1.0.3

func (c Options) Validate(value any) error

type PhoneNumber added in v1.0.6

type PhoneNumber struct {
	Format     string // Format string, e.g., "(00420) 000 000 000"
	AllowEmpty bool   // Allow empty values
}

func (PhoneNumber) Validate added in v1.0.6

func (c PhoneNumber) Validate(value any) error

type Range added in v1.0.5

type Range struct {
	Min float64
	Max float64
}

func (Range) Validate added in v1.0.5

func (r Range) Validate(value any) error

type RegularExpression added in v1.0.2

type RegularExpression struct {
	Regexp string
}

func (RegularExpression) Validate added in v1.0.2

func (c RegularExpression) Validate(value any) error

type Required

type Required struct{}

func (Required) Validate

func (c Required) Validate(value any) error

type Struct added in v1.0.2

type Struct struct {
	Struct interface{}
}

func (Struct) Validate added in v1.0.2

func (c Struct) Validate(value any) error

type Url added in v1.0.5

type Url struct {
	AllowEmpty     bool
	AllowedSchemes []string
}

func (Url) Validate added in v1.0.5

func (c Url) Validate(value any) error

Jump to

Keyboard shortcuts

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