repository

package
v0.0.0-...-36feab7 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPostNotFound = errors.New("post not found")
)

Post data errors

Functions

This section is empty.

Types

type LikeRepository

type LikeRepository interface {
	Create(ctx context.Context, postID int, userReferenceID string) error
	Delete(ctx context.Context, postID int, userReferenceID string) error
}

LikeRepository is a high level interface used to manipulate persisted post like data.

func NewLikeRepository

func NewLikeRepository(db database.Database) LikeRepository

NewLikeRepository returns a new instance of LikeRepository.

type PostRepository

type PostRepository interface {
	Create(ctx context.Context, p *model.Post) error
	GetFeed(ctx context.Context, userReferenceID string) ([]*dto.FeedItem, error)
	Get(ctx context.Context, referenceID, userReferenceID string) (*model.Post, error)
}

PostRepository is a high level interface used to manipulate post data.

func NewPostRepository

func NewPostRepository(url string) PostRepository

NewPostRepository returns a new instance of PostRepository.

Jump to

Keyboard shortcuts

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