pin

package
v0.0.0-...-38b1c69 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSizeBatchPin = 100

Variables

View Source
var (
	ErrPinNotAccess    = errors.New("pin is not available")
	ErrPinDeleted      = errors.New("pin has been deleted")
	ErrForbiddenAction = errors.New("this action is not available to the user")
	ErrEmptyBatch      = errors.New("an empty batch was received")
	ErrSizeBatch       = errors.New("the batch size exceeds the maximum possible")
)
View Source
var ErrBadMIMEType = errors.New("bad mime type")

Functions

func New

func New(log *log.Logger, imgCase image.Usecase, repo repo.Repository) *pinCase

Types

type PinUpdateData

type PinUpdateData struct {
	Title       *string  `json:"title"`
	Description *string  `json:"description"`
	Public      *bool    `json:"public"`
	Tags        []string `json:"tags"`
}

func (PinUpdateData) MarshalEasyJSON

func (v PinUpdateData) MarshalEasyJSON(w *jwriter.Writer)

MarshalEasyJSON supports easyjson.Marshaler interface

func (PinUpdateData) MarshalJSON

func (v PinUpdateData) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (*PinUpdateData) UnmarshalEasyJSON

func (v *PinUpdateData) UnmarshalEasyJSON(l *jlexer.Lexer)

UnmarshalEasyJSON supports easyjson.Unmarshaler interface

func (*PinUpdateData) UnmarshalJSON

func (v *PinUpdateData) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

type Usecase

type Usecase interface {
	ViewFeedPin(ctx context.Context, userID int, cfg pin.FeedPinConfig) (pin.FeedPin, error)
	CreateNewPin(ctx context.Context, pin *entity.Pin, mimeTypePicture string, sizePicture int64, picture io.Reader) error
	DeletePinFromUser(ctx context.Context, pinID, userID int) error
	SetLikeFromUser(ctx context.Context, pinID, userID int) (int, error)
	CheckUserHasSetLike(ctx context.Context, pinID, userID int) (bool, error)
	DeleteLikeFromUser(ctx context.Context, pinID, userID int) (int, error)
	EditPinByID(ctx context.Context, pinID, userID int, updateData *PinUpdateData) error
	ViewAnPin(ctx context.Context, pinID, userID int) (*entity.Pin, error)
	IsAvailablePinForFixOnBoard(ctx context.Context, pinID, userID int) error
	IsAvailableBatchPinForFixOnBoard(ctx context.Context, pinID []int, userID int) error
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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