controller

package
v0.0.0-...-e2ac41f Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBook

func CreateBook(ctx *gin.Context)

POST /books Create new book

func DeleteBook

func DeleteBook(ctx *gin.Context)

DELETE /books/:id Delete a book

func GetAllBooks

func GetAllBooks(ctx *gin.Context)

GET /books Find all books

func GetBookByID

func GetBookByID(ctx *gin.Context)

GET /books/:id Find a book

func LoginUser

func LoginUser(ctx *gin.Context)

func UpdateBook

func UpdateBook(ctx *gin.Context)

PUT /books/:id Update a book

Types

type CreateBookInput

type CreateBookInput struct {
	Title  string `json:"title" binding:"required"`
	Author string `json:"author" binding:"required"`
	Year   string `json:"year" binding:"required"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type UpdateBookInput

type UpdateBookInput struct {
	Title  string `json:"title"`
	Author string `json:"author"`
	Year   string `json:"year"`
}

Jump to

Keyboard shortcuts

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