likes

package
v0.0.0-...-dfd90ba Latest Latest
Warning

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

Go to latest
Published: May 24, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDb                = errors.New("db error")
	ErrPinNotFound       = errors.New("no such pin")
	ErrAuthorNotFound    = errors.New("no such author")
	ErrLikeNotFound      = errors.New("no such like")
	ErrLikeAlreadyExists = errors.New("like already exists")
)

Functions

This section is empty.

Types

type Repository

type Repository interface {
	Create(pinId, authorId int) error
	Delete(pinId, authorId int) error

	ListByAuthor(authorId int) ([]models.Like, error)
	ListByPin(pinId int) ([]models.Like, error)

	PinExists(pinId int) (bool, error)
	UserExists(userId int) (bool, error)
	LikeExists(pinId, authorId int) (bool, error)
}

type Service

type Service interface {
	Like(pinId, authorId int) error
	Unlike(pinId, authorId int) error

	ListByAuthor(authorId int) ([]models.Like, error)
	ListByPin(pinId int) ([]models.Like, error)
}

Directories

Path Synopsis
delivery
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
repository

Jump to

Keyboard shortcuts

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