model

package
v0.0.0-...-b174aef Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteBook

func DeleteBook(id int64) error

func GetDB

func GetDB() *gorm.DB

func SetDB

func SetDB(database *gorm.DB)

Types

type Book

type Book struct {
	gorm.Model
	Name        string `json:"name"`
	Author      string `json:"author"`
	Publication string `json:"publication"`
}

func GetAllBooks

func GetAllBooks() ([]Book, error)

func GetBookById

func GetBookById(Id int64) (*Book, error)

func (*Book) CreateBook

func (b *Book) CreateBook() (*Book, error)

Jump to

Keyboard shortcuts

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