repository

package
v0.0.0-...-f6ebad7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

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

type RequestError struct {
	Error   error
	Message string
	Code    int
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL