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] }
Click to show internal directories.
Click to hide internal directories.