database

package
v0.0.0-...-f9f454f Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Database = DB{}

Database is the database connexion instance

Functions

func DBURI

func DBURI() string

DBURI returns the database URI

func Init

func Init() error

Init initializes the database connection

Types

type DB

type DB struct {
	Client         *mongo.Client
	Collection     *mongo.Collection
	UserCollection *mongo.Collection
}

DB database structure

func (*DB) Close

func (db *DB) Close() error

Close from the database

func (*DB) GetCollection

func (db *DB) GetCollection() *mongo.Collection

GetCollection returns the metrics collection

func (*DB) GetUserCollection

func (db *DB) GetUserCollection() *mongo.Collection

GetUserCollection returns the metrics collection

Jump to

Keyboard shortcuts

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