database

package
v0.0.0-...-672f80e Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MongoURL string        // MongoURL is the url of the mongo database
	Mg       MongoInstance // Mg is the mongo instance
)

Functions

func Connect

func Connect(mongoURL string) error

Connect connects to the database

func GetCollection

func GetCollection(name string) *mongo.Collection

GetCollection returns a collection from the database with the given name

func GetCourseData

func GetCourseData() (map[string]models.CourseData, error)

func GetEdt

func GetEdt(uuid string) (bson.M, error)

GetEdt returns the edt of a student from the database

func StoreCourseEdt

func StoreCourseEdt(courseEdt map[string]models.CourseData) error

func StoreEdt

func StoreEdt(edt models.StudentEDT)

StoreEdt stores the edt in the database

Types

type MongoInstance

type MongoInstance struct {
	Client *mongo.Client   // Mongo client
	DB     *mongo.Database // Mongo database
}

MongoInstance contains the Mongo client and database objects

Jump to

Keyboard shortcuts

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