db

package
v0.0.0-...-9877cfd Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DBName = "microblogging"
View Source
var MongoCN = ConectarBD()

MongoCN es el objeto de conexión a la base de datos

Functions

func BorroTweet

func BorroTweet(twt models.Tweet, ID string) (bool, error)

ModificoRegistro permite modificar el perfil del tweet

func BuscoPerfil

func BuscoPerfil(ID string) (models.Usuario, error)

BuscoPerfil - busca un perfil en la BD

func ChequeoConnection

func ChequeoConnection() int

ChequeoConnection es el ping a la BD

func ChequeoYaExisteUsuario

func ChequeoYaExisteUsuario(email string) (models.Usuario, bool, string)

ChequeoYaExisteUsuario recibe un email de parámetro y chequea si ya está en la db

func ConectarBD

func ConectarBD() *mongo.Client

ConectarBD es la función que me permite conectar a la base de datos

func EncriptarPassword

func EncriptarPassword(pass string) (string, error)

EncriptarPassword es la rutina que me permite encriptar la password recibida

func InsertoRegistro

func InsertoRegistro(u models.Usuario) (string, bool, error)

InsertoRegistro es la parada final con la db para insertarlos datos del usuario

func InsertoTweet

func InsertoTweet(t models.GraboTweet) (string, bool, error)

InsertoTweet graba el tweet en la BD

func IntentoLogin

func IntentoLogin(email string, password string) (models.Usuario, bool)

IntentoLogin realiza el chequeo de login a la BD

func LeoTweets

func LeoTweets(ID string, pagina int64) ([]*models.DevuelvoTweets, bool)

LeoTweets lee los tweets de un perfil, Vamos a devolver un slice, no sabemos la cantidad de tweets que usaremos

func ModificoRegistro

func ModificoRegistro(u models.Usuario, ID string) (bool, error)

ModificoRegistro permite modificar el perfil del usuario

Types

This section is empty.

Jump to

Keyboard shortcuts

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