controllers

package
v0.0.0-...-b26fc39 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthController

type AuthController struct{}

func (*AuthController) CSRF

func (l *AuthController) CSRF(e echo.Context) error

func (*AuthController) Login

func (l *AuthController) Login(e echo.Context) error

Login is the login api entry point for logging in an existing user and attaching a JWT

func (*AuthController) Logout

func (l *AuthController) Logout(e echo.Context) error

Logout clears the browser

type CrowdSourcedUserController

type CrowdSourcedUserController struct{}

CrowdSourcedUsers address the use case where we want to store data from participants from platforms like Mturk or Prolific. In these cases, we do not want to store their emails, but simply want to create a record associated with the ID and data.

func (*CrowdSourcedUserController) CreateCrowdSourcedUserAndLogin

func (c *CrowdSourcedUserController) CreateCrowdSourcedUserAndLogin(e echo.Context) error

CreateCrowdSourcedUserAndLogin creates a crowdsourced user and logs them in automatically

func (*CrowdSourcedUserController) GetCrowdSourcedUserByCrowdSourcedUserAndStudyId

func (c *CrowdSourcedUserController) GetCrowdSourcedUserByCrowdSourcedUserAndStudyId(e echo.Context) error

GetCrowdSourcedUserByCrowdSourcedUserAndStudyId gets a crowd sourced user by the given id

func (*CrowdSourcedUserController) HandleSetComplete

func (c *CrowdSourcedUserController) HandleSetComplete(e echo.Context) error

HandleSetComplete sets a random string as the completion code

type ParticipantDataController

type ParticipantDataController struct{}

func (*ParticipantDataController) CreateParticipantData

func (s *ParticipantDataController) CreateParticipantData(e echo.Context) error

CreateParticipantData creates a record containing participant data for a given task

func (*ParticipantDataController) GetParticipantDataByStudyIdAndTaskOrder

func (s *ParticipantDataController) GetParticipantDataByStudyIdAndTaskOrder(e echo.Context) error

GetParticipantDataByStudyIdAndTaskOrder gets the participant data by the study id and task order

type StudyController

type StudyController struct{}

func (*StudyController) ArchiveStudyById

func (s *StudyController) ArchiveStudyById(e echo.Context) error

ArchiveStudyById sets the deletedAt field to the current date effectively deleting it from a researcher perspective. This allows us to maintain a link between "deleted studies" and existing participant data. Maybe in the future, allow for study deletion and cascade this affect to participant data?

func (*StudyController) CreateStudy

func (s *StudyController) CreateStudy(e echo.Context) error

CreateStudy creates a study

func (*StudyController) GetCrowdSourcedUsersByStudyId

func (s *StudyController) GetCrowdSourcedUsersByStudyId(e echo.Context) error

GetCrowdSourcedUsersByStudyId gets all the crowdsourced users for a given study

func (*StudyController) GetStudiesByOrganization

func (s *StudyController) GetStudiesByOrganization(e echo.Context) error

GetStudiesByOrganization gets all studies for a given organization. Organizations cannot get studies from a different organization.

func (*StudyController) GetStudyById

func (s *StudyController) GetStudyById(e echo.Context) error

GetStudyById gets a study by the given id

func (*StudyController) GetStudyUsersByStudyId

func (s *StudyController) GetStudyUsersByStudyId(e echo.Context) error

GetStudyUsersByStudyId

func (*StudyController) SnapshotStudyByStudyId

func (s *StudyController) SnapshotStudyByStudyId(e echo.Context) error

SnapshotStudyByStudyId

func (*StudyController) UpdateStudy

func (s *StudyController) UpdateStudy(e echo.Context) error

UpdateStudy updates the study

type StudyUserController

type StudyUserController struct{}

func (*StudyUserController) CreateStudyUser

func (s *StudyUserController) CreateStudyUser(e echo.Context) error

CreateStudyUser creates a study user

func (*StudyUserController) UpdateStudyUser

func (s *StudyUserController) UpdateStudyUser(e echo.Context) error

UpdateStudyUser updates the given study user

type SummaryController

type SummaryController struct{}

func (*SummaryController) GetStudyUsersSummary

func (s *SummaryController) GetStudyUsersSummary(e echo.Context) error

GetStudyUsersSummary gets the study user summary which is a mapping between the user id and study ids that the user is registered to

type TaskController

type TaskController struct{}

func (*TaskController) GetAllTasks

func (t *TaskController) GetAllTasks(e echo.Context) error

GetAllTasks retrieves all tasks from the database

func (*TaskController) GetTaskById

func (t *TaskController) GetTaskById(e echo.Context) error

GetTaskById retrieves a task with the given id

type UserController

type UserController struct{}

func (*UserController) CreateUser

func (u *UserController) CreateUser(e echo.Context) error

CreateUser saves the given user into the database

func (*UserController) DeleteUserById

func (u *UserController) DeleteUserById(e echo.Context) error

DeleteUserById deletes the user with a given id. This route is only for deleting guests

func (*UserController) GetStudyUsersByUserId

func (u *UserController) GetStudyUsersByUserId(e echo.Context) error

GetStudyUsersByUserId retrieves all study users for the given user id

func (*UserController) GetUserById

func (u *UserController) GetUserById(e echo.Context) error

GetUserById retrieves the user by the given id. The user must be logged in first, and the id of the logged in cookie must be the same as what is received in the param

func (*UserController) GetUsersByOrganizationId

func (u *UserController) GetUsersByOrganizationId(e echo.Context) error

GetUsersByOrganizationId retrieves all of the given members and guests for a given organization

func (*UserController) HandleForgotPassword

func (u *UserController) HandleForgotPassword(e echo.Context) error

SendForgotPasswordEmail sends an email and sets the changePasswordRequired flag to true for the user

func (*UserController) UpdateUser

func (u *UserController) UpdateUser(e echo.Context) error

UpdateUser updates the given user

func (*UserController) UpdateUserPassword

func (u *UserController) UpdateUserPassword(e echo.Context) error

UpdateUserPassword updates the users password with a new salted and hashed password

Jump to

Keyboard shortcuts

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