Documentation ¶
Index ¶
- Variables
- func CountInjects(ctx context.Context, params map[string]interface{}) (int64, error)
- func CountMedicalCases(ctx context.Context, params map[string]interface{}) (int64, error)
- func CountTeams(ctx context.Context, params map[string]interface{}) (int64, error)
- func CreateExercise(ctx context.Context, exercise *model.Exercise) (err error)
- func CreateInject(ctx context.Context, inject *model.Inject) (err error)
- func CreateMedicalCase(ctx context.Context, mc *model.MedicalCase) (err error)
- func CreateTeam(ctx context.Context, team *model.Team) (err error)
- func CreateUser(ctx context.Context, user *model.User) (err error)
- func DeleteExercise(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)
- func DeleteInject(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)
- func DeleteMedicalCase(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)
- func DeleteMedicalCaseFile(id primitive.ObjectID) (err error)
- func DeleteTeam(ctx context.Context, id primitive.ObjectID, userID primitive.ObjectID) (count int64, err error)
- func DeleteUser(ctx context.Context, user *model.User) (err error)
- func FindExercise(ctx context.Context, id primitive.ObjectID) (result *model.Exercise, err error)
- func FindInject(ctx context.Context, id primitive.ObjectID) (result *model.Inject, err error)
- func FindMedicalCase(ctx context.Context, id primitive.ObjectID) (result *model.MedicalCase, err error)
- func FindTeam(ctx context.Context, id primitive.ObjectID) (result *model.Team, err error)
- func FindUser(ctx context.Context, user *model.User) (result *model.User, err error)
- func GetInjects(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.InjectShort, err error)
- func GetMedicalCaseFile(id primitive.ObjectID, stream io.Writer) (err error)
- func GetMedicalCases(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.MedicalCaseShort, err error)
- func GetTeams(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.Team, err error)
- func GetUser(ctx context.Context, params map[string]interface{}, page int, pageSize int) (result []model.LimitedUser, err error)
- func SetMongoDatabase() error
- func StoreMedicalCaseFile(mc *model.MedicalCase, fh *multipart.FileHeader) (err error)
- func UpdateExercise(ctx context.Context, exercise *model.Exercise, authorID primitive.ObjectID) (err error)
- func UpdateInject(ctx context.Context, inject *model.Inject) (err error)
- func UpdateMedicalCase(ctx context.Context, mc *model.MedicalCase) (err error)
- func UpdateTeam(ctx context.Context, team *model.Team) (err error)
- func UpdateUser(ctx context.Context, user *model.User) (err error)
Constants ¶
This section is empty.
Variables ¶
var MongoSession *mongo.Database
MongoSession Handels the mongo Database needs to be public for integration testing.
Functions ¶
func CountInjects ¶
CountInjects returns the number of total injects in the database
func CountMedicalCases ¶
CountMedicalCases returns the number of total documents inserted
func CountTeams ¶
CountTeams returns the number of total teams inserted
func CreateExercise ¶
CreateExercise will insert an exercise
func CreateInject ¶
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 ¶
CreateTeam will insert a team
func CreateUser ¶
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 ¶
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 ¶
DeleteUser deletes a user, this is currently used for obsolete code users
func FindExercise ¶
FindExercise finds an exercise
func FindInject ¶
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 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 ¶
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 ¶
UpdateInject updates an inject
func UpdateMedicalCase ¶
func UpdateMedicalCase(ctx context.Context, mc *model.MedicalCase) (err error)
UpdateMedicalCase updates a medical case
func UpdateTeam ¶
UpdateTeam updates a team
Types ¶
This section is empty.