storage

package
v0.0.0-...-ff699f0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MongoSession *mongo.Database

MongoSession Handels the mongo Database needs to be public for integration testing.

Functions

func CountInjects

func CountInjects(ctx context.Context, params map[string]interface{}) (int64, error)

CountInjects returns the number of total injects in the database

func CountMedicalCases

func CountMedicalCases(ctx context.Context, params map[string]interface{}) (int64, error)

CountMedicalCases returns the number of total documents inserted

func CountTeams

func CountTeams(ctx context.Context, params map[string]interface{}) (int64, error)

CountTeams returns the number of total teams inserted

func CreateExercise

func CreateExercise(ctx context.Context, exercise *model.Exercise) (err error)

CreateExercise will insert an exercise

func CreateInject

func CreateInject(ctx context.Context, inject *model.Inject) (err error)

CreateInject will insert an inject

func CreateMedicalCase

func CreateMedicalCase(ctx context.Context, mc *model.MedicalCase) (err error)

CreateMedicalCase will store a medical case

func CreateTeam

func CreateTeam(ctx context.Context, team *model.Team) (err error)

CreateTeam will insert a team

func CreateUser

func CreateUser(ctx context.Context, user *model.User) (err error)

CreateUser will create a user

func DeleteExercise

func DeleteExercise(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)

DeleteExercise deletes an exercise by a given id

func DeleteInject

func DeleteInject(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)

DeleteInject deletes an inject by a given id

func DeleteMedicalCase

func DeleteMedicalCase(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)

DeleteMedicalCase deletes a medical case by a given id

func DeleteMedicalCaseFile

func DeleteMedicalCaseFile(id primitive.ObjectID) (err error)

DeleteMedicalCaseFile deletes a file from a bucket

func DeleteTeam

func DeleteTeam(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)

DeleteTeam deletes a team by a given id

func DeleteUser

func DeleteUser(ctx context.Context, user *model.User) (err error)

DeleteUser deletes a user, this is currently used for obsolete code users

func FindExercise

func FindExercise(ctx context.Context, id primitive.ObjectID) (result *model.Exercise, err error)

FindExercise finds an exercise

func FindInject

func FindInject(ctx context.Context, id primitive.ObjectID) (result *model.Inject, err error)

FindInject finds an inject by id

func FindMedicalCase

func FindMedicalCase(ctx context.Context, id primitive.ObjectID) (result *model.MedicalCase, err error)

FindMedicalCase finds a medical case

func FindTeam

func FindTeam(ctx context.Context, id primitive.ObjectID) (result *model.Team, err error)

FindTeam finds a specific team

func FindUser

func FindUser(ctx context.Context, user *model.User) (result *model.User, err error)

FindUser will find a user on a subset of a complete user model

func GetInjects

func GetInjects(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.InjectShort, err error)

GetInjects returns an array of injects

func GetMedicalCaseFile

func GetMedicalCaseFile(id primitive.ObjectID, stream io.Writer) (err error)

GetMedicalCaseFile returns a specific File for a medical case

func GetMedicalCases

func GetMedicalCases(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.MedicalCaseShort, err error)

GetMedicalCases returns an array of the medicalcases in the short version

func GetTeams

func GetTeams(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.Team, err error)

GetTeams returns an array of the teams

func GetUser

func GetUser(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.LimitedUser, err error)

GetUser returns an array of users

func SetMongoDatabase

func SetMongoDatabase() error

SetMongoDatabase sets the database when ever a server is created

func StoreMedicalCaseFile

func StoreMedicalCaseFile(mc *model.MedicalCase, fh *multipart.FileHeader) (err error)

StoreMedicalCaseFile stores the provided documents to a medical case

func UpdateExercise

func UpdateExercise(ctx context.Context, exercise *model.Exercise, authorID primitive.ObjectID) (err error)

UpdateExercise updates an exercise

func UpdateInject

func UpdateInject(ctx context.Context, inject *model.Inject) (err error)

UpdateInject updates an inject

func UpdateMedicalCase

func UpdateMedicalCase(ctx context.Context, mc *model.MedicalCase) (err error)

UpdateMedicalCase updates a medical case

func UpdateTeam

func UpdateTeam(ctx context.Context, team *model.Team) (err error)

UpdateTeam updates a team

func UpdateUser

func UpdateUser(ctx context.Context, user *model.User) (err error)

UpdateUser will create a user

Types

This section is empty.

Jump to

Keyboard shortcuts

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