Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Book ¶
type Book struct { ID string `json:"id"` Title string `json:"title"` Author string `json:"author"` Publisher string `json:"publisher"` ISBN string `json:"isbn"` Year int `json:"year"` Edition int `json:"edition,omitempty"` // omitempty for optional fields Rating int `json:"rating"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` DeletedAt *time.Time `json:"deleted_at,omitempty"` // omitempty for optional fields }
Book represents a Book
type BookInterface ¶
type BookInterface interface { List(ctx *gin.Context) ([]Book, error) Get(ctx *gin.Context, uuid string) (Book, error) Create(ctx *gin.Context, book Book) (Book, error) GetDatabaseObject() (*gorm.DB, error) }
BookInterface represents a Book interface
func NewBookStore ¶
func NewBookStore(db *gorm.DB) BookInterface
NewBookStore creates a new BookStore instance
type BookRepo ¶
BookRepo represents a Book
func (*BookRepo) Create ¶
Create creates a new Book into the database and returns a new Book or an error
func (*BookRepo) GetDatabaseObject ¶
GetDatabaseObject return the databaseobject is set or return an error
Click to show internal directories.
Click to hide internal directories.