service

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

This section is empty.

Variables

View Source
var (
	ErrAddingToCollection      = errors.New("error adding cube to the collection")
	ErrCubeAlreadyInCollection = errors.New("cube already in collection")
)
View Source
var (
	ErrUserAlreadyExists  = errors.New("user already exists")
	ErrInvalidCredentials = errors.New("invalid credentials")
)

Functions

This section is empty.

Types

type Service

type Service interface {
	RegisterUser(ctx context.Context, userEmail, name, password string) error
	LoginUser(ctx context.Context, userEmail, password string) (*models.User, error)

	AddCube(ctx context.Context, userEmail, name, brand, shape, image string) error
	DeleteCube(ctx context.Context, userEmail string, cubeID int64) error

	AddCubeToCollection(ctx context.Context, userEmail string, cubeID int64) error
	GetOwnedCubes(ctx context.Context, useEmail string) ([]models.Cube, error)
	RemoveCubeFromCollection(ctx context.Context, userEmail string, cubeID int64) error
}

func New

func New(_repo repository.Repository) Service

Jump to

Keyboard shortcuts

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