Documentation ¶ Index ¶ func New(db *gorm.DB, rdsPool *redis.Pool) irepository.BookRepository type Book func (Book) FromBookEntity(e *entity.Book) *Book func (b *Book) ToBookEntity(rating float64) *entity.Book type BookWithRating func (b *BookWithRating) ToBookEntity() *entity.Book Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func New ¶ func New(db *gorm.DB, rdsPool *redis.Pool) irepository.BookRepository Types ¶ type Book ¶ type Book struct { Id int `gorm:"primary_key;column:id"` Title string `gorm:"column:title"` ReleasedYear int `gorm:"column:released_year"` CreatedAt *time.Time `gorm:"column:created_at"` UpdatedAt *time.Time `gorm:"column:updated_at"` } func (Book) FromBookEntity ¶ func (Book) FromBookEntity(e *entity.Book) *Book func (*Book) ToBookEntity ¶ func (b *Book) ToBookEntity(rating float64) *entity.Book type BookWithRating ¶ type BookWithRating struct { Book Rating float64 `gorm:"column:rating"` } func (*BookWithRating) ToBookEntity ¶ func (b *BookWithRating) ToBookEntity() *entity.Book Source Files ¶ View all Source files model.go repository.go Click to show internal directories. Click to hide internal directories.