mongodb

package
v0.0.0-...-82d4fcb Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloseMongoDB

func CloseMongoDB(db *MongoDB)

CloseDB will dissconnect to MongoDB

Types

type MongoDB

type MongoDB struct {
	Session       *mongo.Client
	Users         *mongo.Collection
	DeletedUsers  *mongo.Collection
	Income        *mongo.Collection
	DeletedIncome *mongo.Collection
	Cost          *mongo.Collection
	DeletedCost   *mongo.Collection
	IncomeHistory *mongo.Collection
	CostHistory   *mongo.Collection
}

func ConnectMongoDB

func ConnectMongoDB(cfg *utils.ServerConfig) *MongoDB

ConnectDB will build connection to MongoDB Atlas

func (*MongoDB) CreateUserFromGoth

func (db *MongoDB) CreateUserFromGoth(user *goth.User) (*models.UserModel, error)

CreateUserFromGoth using data from goth to create user

func (*MongoDB) FindUserByAPIKey

func (db *MongoDB) FindUserByAPIKey(apiKey string) (*models.UserModel, error)

FindUserByAPIKey will find user related to the APIKey

func (*MongoDB) FindUserByJWT

func (db *MongoDB) FindUserByJWT(email string, provider string, userID string) (*models.UserModel, error)

FindUserByJWT will find user related to the JWT Token

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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