mongodb

package
v0.0.0-...-1a5deed Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2020 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzeRequestRepository

func NewAnalyzeRequestRepository(db *mongo.Database, collection string) database.AnalyzeRequestRepository

NewAnalyzeRequestRepository creates a new instance of the user repository

func NewMongoDB

func NewMongoDB(client *mongo.Database) database.DB

NewMongoDB creates a new instance of the mongodb client

func NewUserRepository

func NewUserRepository(db *mongo.Database, collection string) database.UserRepository

NewUserRepository creates a new instance of the user repository

Types

type AnalyzeRequestRepository

type AnalyzeRequestRepository struct {
	mongodb.Repository
}

AnalyzeRequestRepository creates a new instance of the user repository

func (*AnalyzeRequestRepository) FindByID

func (repository *AnalyzeRequestRepository) FindByID(ID id.ID) (analyzeRequest entities.AnalyzeRequest, err error)

FindByID finds a user in the database using it's ID

func (*AnalyzeRequestRepository) IndexForUser

func (repository *AnalyzeRequestRepository) IndexForUser(userID id.ID, skip *int, limit *int, sortBy *string, sortDirection *string) (analyzeRequests []entities.AnalyzeRequest, err error)

IndexForUser fetches all the analyze requests for the given user

func (*AnalyzeRequestRepository) Store

func (repository *AnalyzeRequestRepository) Store(analyzeRequest entities.AnalyzeRequest) error

Store stores a user on the mongodb repository

type MongoDB

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

MongoDB is the struct for mongodb

func (*MongoDB) AnalyzeRequestRepository

func (db *MongoDB) AnalyzeRequestRepository() database.AnalyzeRequestRepository

AnalyzeRequestRepository returns the Analyze Request Repository

func (*MongoDB) UserRepository

func (db *MongoDB) UserRepository() database.UserRepository

UserRepository returns the user repository

type UserRepository

type UserRepository struct {
	mongodb.Repository
}

UserRepository creates a new instance of the user repository

func (*UserRepository) FindByEmail

func (repository *UserRepository) FindByEmail(email string) (user *entities.User, err error)

FindByEmail searches a user using the email

func (*UserRepository) FindByID

func (repository *UserRepository) FindByID(ID id.ID) (user *entities.User, err error)

FindByID finds a user in the database using it's ID

func (*UserRepository) Store

func (repository *UserRepository) Store(user entities.User) error

Store stores a user on the mongodb repository

Jump to

Keyboard shortcuts

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