mongo

package
v0.0.0-...-4db4453 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bookmark

type Bookmark struct {
	ID     primitive.ObjectID `bson:"_id,omitempty"`
	UserID primitive.ObjectID `bson:"userId"`
	URL    string             `bson:"url"`
	Title  string             `bson:"title"`
}

type BookmarkRepository

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

func NewBookmarkRepository

func NewBookmarkRepository(db *mongo.Database, collection string) *BookmarkRepository

func (BookmarkRepository) CreateBookmark

func (r BookmarkRepository) CreateBookmark(ctx context.Context, user *models.User, bm *models.Bookmark) (string, error)

func (BookmarkRepository) DeleteBookmark

func (r BookmarkRepository) DeleteBookmark(ctx context.Context, user *models.User, id string) error

func (BookmarkRepository) GetBookmark

func (r BookmarkRepository) GetBookmark(ctx context.Context, user *models.User, id string) (*models.Bookmark, error)

func (BookmarkRepository) GetBookmarks

func (r BookmarkRepository) GetBookmarks(ctx context.Context, user *models.User) ([]*models.Bookmark, error)

func (BookmarkRepository) UpdateBookmark

func (r BookmarkRepository) UpdateBookmark(ctx context.Context, user *models.User, bm *models.Bookmark) error

Jump to

Keyboard shortcuts

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