repository

package
v0.0.0-...-a20cc02 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AdminRole    int64 = 1
	SellerRole   int64 = 2
	CustomerRole int64 = 3
)

Variables

View Source
var (
	ErrItemNotFoundInCollection = errors.New("item not found")
)

Functions

This section is empty.

Types

type Repository

type Repository interface {
	SaveUser(ctx context.Context, email, name, password string) error
	GetUserByEmail(ctx context.Context, email string) (*entity.User, error)
	DeleteUserByEmail(ctx context.Context, email string) error

	SaveCube(ctx context.Context, name, brand, shape, image string) error
	DeleteCubeByID(ctx context.Context, id int64) error

	GetCollectionByUserID(ctx context.Context, userID int64) ([]entity.ColelctionPrimaryKey, error)
	SaveItemToCollection(ctx context.Context, userID, cubeID int64) error
	GetItemsFromCollection(ctx context.Context, email string) ([]entity.Collection, error)
	GetFromCollectionByItemID(ctx context.Context, email string, cubeID int64) (*entity.Collection, error)
	DeleteFromCollectionByItemID(ctx context.Context, userID, cubeID int64) error
}

brief: this interface wraps the basic CRUD operations.

func New

func New(_db *sql.DB) Repository

Jump to

Keyboard shortcuts

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