storage

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MongoConnect

func MongoConnect() (*mongo.Database, error)

Types

type DB

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

func New

func New(mongo *mongo.Database) *DB

func (*DB) Repos

func (db *DB) Repos() RepoRepository

func (*DB) Subscribers

func (db *DB) Subscribers() SubscriberRepository

type RepoRepository

type RepoRepository interface {
	Create(user *entity.Repo) (*entity.Repo, error)
	FindByUrlAndUserId(url string, userId string) (*entity.Repo, error)
	FindById(repoID string) (*entity.Repo, error)
	FindAll(userId string) ([]*entity.Repo, error)
	Delete(repoId string) error
	DeleteMany(userId string) error
}

type Store

type Store interface {
	Repos() RepoRepository
	Subscribers() SubscriberRepository
}

type SubscriberRepository

type SubscriberRepository interface {
	Create(user *entity.Subscriber) (*entity.Subscriber, error)
	FindByEmailAndRepoId(email string, repoId string) (*entity.Subscriber, error)
	FindById(subID string) (*entity.Subscriber, error)
	Update(subscriber *entity.Subscriber) (*entity.Subscriber, error)
	Confirm(subId string, confirmed bool) error
	GetAll() ([]*entity.Subscriber, error)
	FindAll(repoId string) ([]*entity.Subscriber, error)
	Delete(subId string) error
	DeleteMany(repoId string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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