controllers

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateBook

func CreateBook(c *gin.Context)

Function to create a particular book

func DeleteBook

func DeleteBook(c *gin.Context)

Function to delete a particular book

func FindBook

func FindBook(c *gin.Context)

Function to find a particular book

func FindBooks

func FindBooks(c *gin.Context)

Function to find all the existing books

func UpdateBook

func UpdateBook(c *gin.Context)

Function to update a particular book

Types

type CreateBookInput

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

Create struct for valid input

type UpdateBookInput

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

Same struct as CreateBookInput except the binding is not required anymore

Jump to

Keyboard shortcuts

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