database

package
v0.0.0-...-6dd8d72 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(app config.AppConfig) *mongo.Database

openDB creates a new database connection and returns the Database

Types

type DatabaseRepo

type DatabaseRepo interface {
	UserRepo
}

DatabaseRepo is the interface for all repository functions

func NewDBRepo

func NewDBRepo(app *config.AppConfig, conn *mongo.Database) DatabaseRepo

NewMongoDBRepo is the function for returning a mongoDBRepo.

type UserRepo

type UserRepo interface {
	CreateUser(user models.User) (*string, error)
	GetUserById(id string) (*models.User, error)
	GetUserByEmail(email string) (*models.User, error)
}

Jump to

Keyboard shortcuts

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