repo

package
v0.0.0-...-e46c3b8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlogData

type BlogData struct {
	FeedURL     string
	Author      string
	Title       string
	Description string
	Rating      rating.Rating
	Level       level.Level
	Tags        []tag.Tag
	QuickNote   string
}

BlogData is the data for saving blogs.

type FetchData

type FetchData struct {
	Rating rating.Rating
	Level  level.Level
	Tags   []tag.Tag
	Count  uint32
	After  *primitive.ObjectID
}

FetchData represents data for fetching.

type Repo

type Repo interface {
	Save(ctx context.Context, userID uuid.UUID, data *BlogData) (primitive.ObjectID, error)
	Fetch(ctx context.Context, userID uuid.UUID, data *FetchData) ([]model.Blog, error)
}

Repo is an abstraction for the blog repository.

func UseCollection

func UseCollection(coll *mongo.Collection) Repo

UseCollection returns Repo wich uses the given collection.

Jump to

Keyboard shortcuts

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