Documentation ¶
Index ¶
- type BookRepository
- type Repository
- func (r *Repository) Create(input *models.Book) (*models.Book, *RequestError)
- func (r *Repository) Delete(id uint) *RequestError
- func (r *Repository) FindOne(id uint) (*models.Book, *RequestError)
- func (r *Repository) GetBatch(input *models.PaginationInput) (*[]models.Book, int64, *RequestError)
- func (r *Repository) HealthCheck() bool
- func (r *Repository) Update(id uint, input map[string]interface{}) (*models.Book, *RequestError)
- type RequestError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BookRepository ¶
type BookRepository interface { FindOne(id uint) (*models.Book, *RequestError) GetBatch(input *models.PaginationInput) (*[]models.Book, int64, *RequestError) Create(input *models.Book) (*models.Book, *RequestError) Update(id uint, input map[string]interface{}) (*models.Book, *RequestError) Delete(id uint) *RequestError HealthCheck() bool }
func CreateBookRepository ¶
func CreateBookRepository(db *gorm.DB) BookRepository
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func (*Repository) Create ¶
func (r *Repository) Create(input *models.Book) (*models.Book, *RequestError)
func (*Repository) Delete ¶
func (r *Repository) Delete(id uint) *RequestError
func (*Repository) FindOne ¶
func (r *Repository) FindOne(id uint) (*models.Book, *RequestError)
func (*Repository) GetBatch ¶
func (r *Repository) GetBatch(input *models.PaginationInput) (*[]models.Book, int64, *RequestError)
func (*Repository) HealthCheck ¶
func (r *Repository) HealthCheck() bool
func (*Repository) Update ¶
func (r *Repository) Update(id uint, input map[string]interface{}) (*models.Book, *RequestError)
type RequestError ¶
Click to show internal directories.
Click to hide internal directories.