database

package
v0.0.0-...-3d4d258 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBCredentials

type DBCredentials struct {
	Cconnectionstring string `json:"cconnectionstring"`
	Cdbname           string `json:"cdbname"`
	Cdbusername       string `json:"cdbusername"`
	Cdbpassword       string `json:"cdbpassword"`
}

DBCredentials which stores mongoDB Credentials

type MongoDBConnection

type MongoDBConnection struct {
	// contains filtered or unexported fields
}

MongoDBConnection Encapsulates a connection to a database.

func (*MongoDBConnection) GetSession

func (mdb *MongoDBConnection) GetSession() *mgo.Session

GetSession return a new session if there is no previous one.

func (MongoDBConnection) LoadUser

func (mdb MongoDBConnection) LoadUser(Email string) (result structs.User, err error)

LoadUser get data from a user.

func (MongoDBConnection) SaveUser

func (mdb MongoDBConnection) SaveUser(u *structs.User) error

SaveUser register a user so we know that we saw that user already.

Jump to

Keyboard shortcuts

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