Versions in this module Expand all Collapse all v1 v1.0.0 Mar 12, 2023 Changes in this version + var ErrRecordNotFound = errors.New("record not found") + func OpenDB(t *testing.T) (*gorm.DB, func()) + type Book struct + Author string + ID string + Name string + OwnerID string + Status string + type BookOperationsService interface + ListByUser func(userID string) ([]Book, error) + type BookRepository struct + DB *gorm.DB + func NewBookRepository(db *gorm.DB, ps PostingService) *BookRepository + func (bs *BookRepository) Get(b *Book) error + func (bs *BookRepository) List() ([]Book, error) + func (bs *BookRepository) ListByUser(userID string) ([]Book, error) + func (bs *BookRepository) SwapBook(bookID, userID string) (*Book, error) + func (bs *BookRepository) Upsert(b Book) Book + type BookStatus int + const Available + const Swapped + func (o BookStatus) String() string + type PostingService interface + NewOrder func(b Book) error + func NewPostingService() PostingService + type StubbedPostingService struct + func (sps *StubbedPostingService) NewOrder(b Book) error + type User struct + Address string + Country string + ID string + Name string + PostCode string + type UserService struct + DB *gorm.DB + func NewUserService(db *gorm.DB, bs BookOperationsService) *UserService + func (us *UserService) Exists(id string) error + func (us *UserService) Get(id string) (*User, []Book, error) + func (us *UserService) Upsert(u User) (User, error)