database

package
v0.0.0-...-a968f5f Latest Latest
Warning

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

Go to latest
Published: May 28, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AppDB = MongoConnection.Database("twittAppDB")

AppDB is the database for our app

View Source
var MongoConnection = ConnectionToDB()

MongoConnection initializes connection

View Source
var UsersCollection = AppDB.Collection("users")

UsersCollection is the "users" collection within DB

Functions

func CheckConnection

func CheckConnection() bool

CheckConnection checks mongoDB connection

func CheckExistentUser

func CheckExistentUser(email string) (models.User, bool, string)

CheckExistentUser searches a user in DB by email

func ConnectionToDB

func ConnectionToDB() *mongo.Client

ConnectionToDB creates Db connection

func LoginUser

func LoginUser(email, password string) (models.User, bool)

LoginUser logs user in using email/password

Types

This section is empty.

Jump to

Keyboard shortcuts

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