models

package
v0.0.0-...-de2f53b Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Book

type Book struct {
	Id     int    `json:"id"`
	Title  string `json:"title"`
	Author string `json:"author"`
	Pages  int    `json:"pages"`
}

Book represents the model for a book record.

type NewBook

type NewBook struct {
	Id     int    `json:"id"`
	Title  string `json:"title" validate:"required"`
	Author string `json:"author" validate:"required"`
	Pages  int    `json:"pages" validate:"required,gt=0"`
}

NewBook is used to create a new book record.

type UpdatedBook

type UpdatedBook struct {
	Id     int    `json:"id" validate:"required"`
	Title  string `json:"title" validate:"required"`
	Author string `json:"author" validate:"required"`
	Pages  int    `json:"pages" validate:"required,gt=0"`
}

UpdateBook is used to update a book record.

Jump to

Keyboard shortcuts

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