Documentation ¶
Index ¶
- func CreateProgram(cc echo.Context) error
- func CreateUser(cc echo.Context) error
- func DeleteClass(cc echo.Context) error
- func DeleteProgram(cc echo.Context) error
- func DeleteUser(cc echo.Context) error
- func GetClass(cc echo.Context) error
- func GetClassMembers(cc echo.Context) error
- func GetProgram(cc echo.Context) error
- func GetUser(cc echo.Context) error
- func JoinClass(cc echo.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateProgram ¶
func CreateProgram(cc echo.Context) error
func CreateUser ¶
func CreateUser(cc echo.Context) error
CreateUser creates a new user object corresponding to either the provided UID or a random new one if none is provided with the default data.
Request Body:
{ "uid": string <optional> }
Returns: Status 200 with a marshalled User struct on success.
func DeleteClass ¶
func DeleteClass(cc echo.Context) error
DeleteClass takes a wid and deletes it. Any programs associated with the class will also be deleted. Users that are in the class will still contain a reference to this class, thus it is the user's responsibility to remove references to a deleted class.
func DeleteProgram ¶
func DeleteProgram(cc echo.Context) error
func DeleteUser ¶
func DeleteUser(cc echo.Context) error
DeleteUser deletes an user along with all their programs from the database.
Request Body:
{ "uid": REQUIRED }
Returns: status 200 on deletion.
func GetClass ¶
func GetClass(cc echo.Context) error
GetClass takes the UID (either of a member or an instructor) and a CID (wid) as a JSON, and returns an object representing the class. If the given UID is not a member or an instructor, an error is returned.
func GetClassMembers ¶
func GetClassMembers(cc echo.Context) error
GetClassMembers returns the user IDs and display names of each member in the requested class. It takes a class id and checks that the given uid is in the class first
func GetProgram ¶
func GetProgram(cc echo.Context) error
GetProgram retrieves information about a single program.
Query parameters: pid
Returns status 200 OK with a marshalled Program struct.
func GetUser ¶
func GetUser(cc echo.Context) error
GetUser acquires the user document with the given uid. The provided context must be a *db.DBContext.
Query Parameters:
- uid string: UID of user to GET
- programs string: Whether to acquire programs.
Returns: Status 200 with marshalled User and programs.
Types ¶
This section is empty.