Documentation ¶
Index ¶
- type Author
- type Book
- func (b *Book) Delete(db *gorm.DB, id int) error
- func (b *Book) GetAll(db *gorm.DB) (*[]Book, error)
- func (b *Book) GetByAuthorID(db *gorm.DB, authorID int) (*[]Book, error)
- func (b *Book) GetByID(db *gorm.DB, id uint) error
- func (b *Book) GetByISBN(db *gorm.DB, isbn string) error
- func (b *Book) Save(db *gorm.DB) error
- func (b *Book) Update(db *gorm.DB, id int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Author ¶
type Book ¶
type Book struct { ID uint `gorm:"primarykey;autoincrement"` ISBN string `json:"isbn"` Title string `json:"title"` Description string `json:"description"` AuthorID uint `json:"author_id"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` }
func (*Book) GetByAuthorID ¶
Click to show internal directories.
Click to hide internal directories.