likedb

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(log *zerolog.Logger, client *mongo.Client) *Store

func (*Store) Create

func (s *Store) Create(ctx context.Context, newLike like.Like) (like.Like, error)

Create inserts a new Like document into the collection.

func (*Store) DeleteByID

func (s *Store) DeleteByID(ctx context.Context, likeID string) error

DeleteByID removes a Like document by its ID.

func (*Store) QueryAllByPostID

func (s *Store) QueryAllByPostID(ctx context.Context, postID string) ([]like.Like, error)

QueryAllByPostID retrieves all Like documents for a specific post.

func (*Store) QueryAllByUserID

func (s *Store) QueryAllByUserID(ctx context.Context, userID string) ([]like.Like, error)

QueryAllByUserID retrieves all Like documents for a specific user.

func (*Store) QueryByID

func (s *Store) QueryByID(ctx context.Context, likeID string) (like.Like, error)

QueryByID retrieves a Like document by its ID.

func (*Store) QueryByUserAndPostID added in v0.4.1

func (s *Store) QueryByUserAndPostID(ctx context.Context, userID string, postID int64) (like.Like, error)

QueryByUserAndPostID retrieves a Like document for a specific user and post.

func (*Store) Update

func (s *Store) Update(ctx context.Context, updatedLike like.Like) (like.Like, error)

Update modifies an existing Like document.

Jump to

Keyboard shortcuts

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