binding

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Equal

func Equal[T constraints.Ordered](src, des T) func(src T) error

func Max

func Max[T constraints.Integer](max T) func(src T) error

func Min

func Min[T constraints.Integer](min T) func(src T) error

func OneOf

func OneOf[T constraints.Ordered](des []T) func(src T) error

Types

type IField

type IField[T constraints.FieldType] interface {
	Value() T
	Valid() error
	Default(n T)
}

type IFn

type IFn[T constraints.FieldType] interface {
}

type IntegerField

type IntegerField[T constraints.Integer] struct {
	// contains filtered or unexported fields
}

func Integer

func Integer[T constraints.Integer](key string, required bool, validators ...func(s T) error) *IntegerField[T]

func (*IntegerField[T]) Default

func (it *IntegerField[T]) Default(n T)

func (*IntegerField[T]) Valid

func (it *IntegerField[T]) Valid() error

func (*IntegerField[T]) Value

func (it *IntegerField[T]) Value() T

type User

type User struct {
	Name *IntegerField[int] `json:"name"`
	Age  *IntegerField[uint]
}

func New

func New() *User

Jump to

Keyboard shortcuts

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