subscriber

package
v0.0.0-...-010a373 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2021 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 Repository

type Repository struct {
	Collection *mongo.Collection
}

func NewRepository

func NewRepository(db *mongo.Database) *Repository

Creates new mongo repository for subscribers

func (*Repository) Confirm

func (r *Repository) Confirm(subID string, confirmed bool) error

Confirms subscribers's email Sets true isConfirmed field

func (*Repository) Create

func (r *Repository) Create(sub *entity.Subscriber) (*entity.Subscriber, error)

Creates subscriber

func (*Repository) Delete

func (r *Repository) Delete(subID string) error

Deletes subscriber from collection

func (*Repository) DeleteMany

func (r *Repository) DeleteMany(repoId string) error

Deletes subscribers belongs to git repository Run after deleting git repository

func (*Repository) FindAll

func (r *Repository) FindAll(repoID string) ([]*entity.Subscriber, error)

Finds all subscribers belongs to git repository

func (*Repository) FindByEmailAndRepoID

func (r *Repository) FindByEmailAndRepoID(email string, repoID string) (*entity.Subscriber, error)

Finds subscriber by email and git repository id

func (*Repository) FindByID

func (r *Repository) FindByID(subID string) (*entity.Subscriber, error)

Finds subscriber by id

func (*Repository) GetAll

func (r *Repository) GetAll() ([]*entity.Subscriber, error)

Gets all subscribers in collection

func (*Repository) Update

func (r *Repository) Update(subscriber *entity.Subscriber) (*entity.Subscriber, error)

Updates subscriber's fields

Jump to

Keyboard shortcuts

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