models

package
v0.0.0-...-48135de Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateStudent

func ValidateStudent(student *Student) error

Types

type Student

type Student struct {
	gorm.Model        // This inserts ID, CreatedAt, UpdatedAt, DeletedAt
	Name       string `json:"name" validate:"nonzero"`
	Age        int    `json:"age" validate:"min=1,max=100"`
	Document   string `json:"document" validate:"len=11,regexp=^[0-9]*$"`
}

Jump to

Keyboard shortcuts

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