Documentation ¶
Index ¶
- func SetupDB() (*gorm.DB, error)
- type Book
- func (b *Book) CreateBook(title, author string, year int) (model.Book, error)
- func (b *Book) DeleteBook(id uint) error
- func (b *Book) GetBooks() ([]model.Book, error)
- func (b *Book) ReadBook(id uint) (model.Book, error)
- func (b *Book) UpdateBook(id uint, title, author string, year int) (model.Book, error)
- type IController
- type IGormDB
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type IController ¶
type IController interface { GetBooks() ([]model.Book, error) CreateBook(title, author string, year int) (model.Book, error) ReadBook(id uint) (model.Book, error) UpdateBook(id uint, title, author string, year int) (model.Book, error) DeleteBook(id uint) error }
var BC IController
type IGormDB ¶
type IGormDB interface { AutoMigrate(dst ...interface{}) error Find(dst interface{}, conds ...interface{}) *gorm.DB Create(dst interface{}) *gorm.DB First(dst interface{}, conds ...interface{}) *gorm.DB Save(dst interface{}) *gorm.DB Delete(dst interface{}, conds ...interface{}) *gorm.DB }
var DB IGormDB
Click to show internal directories.
Click to hide internal directories.