Documentation ¶
Index ¶
- type ArticleRepo
- func (ar ArticleRepo) Create(article *models.Article) error
- func (ar ArticleRepo) Delete(id primitive.ObjectID) (*mongo.DeleteResult, error)
- func (ar ArticleRepo) Get(title string, tags []string, filters models.Filters) ([]models.Article, error)
- func (ar ArticleRepo) GetByID(id primitive.ObjectID) (*models.Article, error)
- func (ar ArticleRepo) Update(id primitive.ObjectID, updateDoc bson.M) *mongo.SingleResult
- type Repository
- type SubscriberRepo
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) Delete ¶
func (ar ArticleRepo) Delete(id primitive.ObjectID) (*mongo.DeleteResult, 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 (sr SubscriberRepo) Delete(id primitive.ObjectID) (*mongo.DeleteResult, error)
func (SubscriberRepo) Get ¶
func (sr SubscriberRepo) Get(email string, filters models.Filters) ([]models.Subscriber, error)
Click to show internal directories.
Click to hide internal directories.