rule

package
v1.1.14 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: BSD-3-Clause Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatetimeInput added in v1.1.4

type DatetimeInput struct {
	// contains filtered or unexported fields
}

func Datetime added in v1.1.4

func Datetime(formats ...string) DatetimeInput

func (DatetimeInput) Passes added in v1.1.4

func (d DatetimeInput) Passes(input contracts.InputValue) (success bool, skipAll bool)

type FileInput

type FileInput struct {
	Attribute string
	Source    contracts.InputSource
}

func (FileInput) Passes

func (f FileInput) Passes(input contracts.InputValue) (success bool, skipAll bool)

type InRule added in v1.1.4

type InRule struct {
	// contains filtered or unexported fields
}

func In added in v1.1.4

func In(values ...string) InRule

func (InRule) Passes added in v1.1.4

func (i InRule) Passes(input contracts.InputValue) (success bool, skipAll bool)

type Messager

type Messager interface {
	Message() string
}

type Namer added in v1.1.12

type Namer interface {
	RoleName() string
}

type NullableInput

type NullableInput struct {
}

func (NullableInput) Passes

func (ni NullableInput) Passes(input contracts.InputValue) (success bool, skipAll bool)

type NumberType

type NumberType string
const (
	TypeInterger NumberType = "integer"
	TypeFloat    NumberType = "float"
	TypeInt      NumberType = "int"
)

type NumericInput

type NumericInput struct {
	// contains filtered or unexported fields
}

func Numeric added in v1.1.4

func Numeric(t NumberType) NumericInput

func (NumericInput) Passes

func (ni NumericInput) Passes(input contracts.InputValue) (success bool, skipAll bool)

type Required

type Required struct {
}

func (Required) Passes

func (r Required) Passes(input contracts.InputValue) (success bool, skipAll bool)

type RequiredIfRule added in v1.1.4

type RequiredIfRule struct {
	// contains filtered or unexported fields
}

func RequiredIf added in v1.1.4

func RequiredIf(fn func() bool) RequiredIfRule

func (RequiredIfRule) Passes added in v1.1.4

func (ri RequiredIfRule) Passes(input contracts.InputValue) (success bool, skipAll bool)

type Rule

type Rule interface {
	Passes(input contracts.InputValue) (success bool, skipAll bool)
}

Jump to

Keyboard shortcuts

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