data

package
v0.0.0-...-372eb2b Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleRepo

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

func (ArticleRepo) Create

func (ar ArticleRepo) Create(article *models.Article) error

func (ArticleRepo) Delete

func (ArticleRepo) Get

func (ar ArticleRepo) Get(title string, tags []string, filters models.Filters) ([]models.Article, error)

func (ArticleRepo) GetByID

func (ar ArticleRepo) GetByID(id primitive.ObjectID) (*models.Article, error)

func (ArticleRepo) Update

func (ar ArticleRepo) Update(id primitive.ObjectID, updateDoc bson.M) *mongo.SingleResult

type Repository

type Repository struct {
	Article interface {
		Create(article *models.Article) error
		GetByID(id primitive.ObjectID) (*models.Article, error)
		Delete(id primitive.ObjectID) (*mongo.DeleteResult, error)
		Get(title string, tags []string, filters models.Filters) ([]models.Article, error)
		Update(id primitive.ObjectID, updateDoc bson.M) *mongo.SingleResult
	}
	Subscriber interface {
		Create(sub *models.Subscriber) error
		Get(email string, filters models.Filters) ([]models.Subscriber, error)
		Delete(id primitive.ObjectID) (*mongo.DeleteResult, error)
	}
}

func NewRepo

func NewRepo(db *db.DB) *Repository

type SubscriberRepo

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

func (SubscriberRepo) Create

func (sr SubscriberRepo) Create(sub *models.Subscriber) error

func (SubscriberRepo) Delete

func (SubscriberRepo) Get

func (sr SubscriberRepo) Get(email string, filters models.Filters) ([]models.Subscriber, error)

Jump to

Keyboard shortcuts

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