models

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeleteRequest

type DeleteRequest struct {
	ID string `json:"id" validate:"required"`
}

func (*DeleteRequest) Validate

func (d *DeleteRequest) Validate() error

type PatchRequest

type PatchRequest struct {
	ID      string `json:"id" validate:"required"`
	Age     int    `json:"age" validate:"required,gt=0,lte=130,number"`
	Surname string `json:"surname" validate:"required,gt=0,lte=200,alpha"`
}

func (*PatchRequest) Validate

func (p *PatchRequest) Validate() error

type Person

type Person struct {
	ID      string `json:"id"`
	Name    string `json:"name" `
	Surname string `json:"surname"`
	Age     int    `json:"age"`
}

type PostRequest

type PostRequest struct {
	Name    string `json:"name" validate:"required,gt=0,lte=200,alpha"`
	Surname string `json:"surname" validate:"required,gt=0,lte=200,alpha"`
	Age     int    `json:"age" validate:"required,gt=0,lte=130,number"`
}

func (*PostRequest) Validate

func (p *PostRequest) Validate() error

Jump to

Keyboard shortcuts

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