pins

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: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateParams

type CreateParams struct {
	Title       string
	Description string
	MediaSource models.Image
	Author      int
}

type FullUpdateParams

type FullUpdateParams struct {
	Id          int
	Title       string
	Description string
}

type Repository

type Repository interface {
	Create(params *CreateParams) (models.Pin, error)
	Get(id int) (models.Pin, error)

	ListByAuthor(userId int, page, limit int) ([]models.Pin, error)
	List(page, limit int) ([]models.Pin, error)
	ListLiked(userID int, page, limit int) ([]models.Pin, error)
	ListWithLikedField(userID int, page, limit int) ([]models.Pin, error)

	FullUpdate(params *FullUpdateParams) (models.Pin, error)
	Delete(id int) error

	IsLikedByUser(pinId, userId int) (bool, error)

	CheckWriteAccess(userId, pinId string) (bool, error)
	CheckReadAccess(userId, pinId string) (bool, error)
}

type Service

type Service interface {
	Create(params *CreateParams) (models.Pin, error)
	Get(id, userId int) (models.Pin, error)
	ListByAuthor(authorId, userId, page, limit int) ([]models.Pin, error)
	List(authorized bool, userId int, liked bool, page, limit int) ([]models.Pin, error)
	FullUpdate(params *FullUpdateParams) (models.Pin, error)
	Delete(id int) error

	SetLikedField(pin *models.Pin, userId int) error

	CheckWriteAccess(userId, pinId string) (bool, error)
	CheckReadAccess(userId, pinId string) (bool, 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