Documentation ¶
Index ¶
- func NewAnalyzeRequestRepository(db *mongo.Database, collection string) database.AnalyzeRequestRepository
- func NewMongoDB(client *mongo.Database) database.DB
- func NewUserRepository(db *mongo.Database, collection string) database.UserRepository
- type AnalyzeRequestRepository
- func (repository *AnalyzeRequestRepository) FindByID(ID id.ID) (analyzeRequest entities.AnalyzeRequest, err error)
- func (repository *AnalyzeRequestRepository) IndexForUser(userID id.ID, skip *int, limit *int, sortBy *string, sortDirection *string) (analyzeRequests []entities.AnalyzeRequest, err error)
- func (repository *AnalyzeRequestRepository) Store(analyzeRequest entities.AnalyzeRequest) error
- type MongoDB
- type UserRepository
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 ¶
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