person

package
v0.0.0-...-76b3d1a Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewValidator

func NewValidator() *validate.XValidator

func ValidateValuer

func ValidateValuer(field validator.FieldLevel) bool

Types

type Person

type Person struct {
	gorm.Model `json:"-" tstype:"-" skip:"yes"`
	ID         uint                    `json:"-" tstype:"-" gorm:"primaryKey"`
	Owner      string                  `json:"-" tstype:"-" validate:"alphanum" skip:"yes"`
	Name       string                  `json:"name" validate:"required" tstype:",required" example:"john"`
	Age        uint                    `json:"age" validate:"number" tstype:"number" example:"13"`
	Gender     enum.Enum[enums.Gender] `json:"gender" tstype:"'male' | 'female' | 'other' | ''" example:"male"`
}

func (Person) Validate

func (p Person) Validate(personValidator *validate.XValidator) error

Jump to

Keyboard shortcuts

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