controllers

package
v0.0.0-...-f90f44b Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateUserHandler

func CreateUserHandler(connection *sql.DB, cnf config.Config) negroni.HandlerFunc

CreateUserHandler creates a new user in the database. Password is saved as a hash.

func DeleteUserHandler

func DeleteUserHandler(connection *sql.DB, cnf config.Config) negroni.HandlerFunc

DeleteUserHandler removes a user from the database. User can only deletes it's own record.

func GetUsernamesHandler

func GetUsernamesHandler(connection *sql.DB) negroni.HandlerFunc

GetUsernamesHandler is a handler for collecting usernames coresponding to user ID's. The request expects a json object in the following format: { "requests":[{"id":1} ,{"id":2},{"id":3}, {"id":4} ]}.

func UpdateUserHandler

func UpdateUserHandler(connection *sql.DB, cnf config.Config) negroni.HandlerFunc

UpdateUserHandler updates an user based on it's user ID. User is only allowed to update it's own record. Verification is being done based on the JWT in the request.

func UserByIndexHandler

func UserByIndexHandler(connection *sql.DB) negroni.HandlerFunc

UserByIndexHandler retrieves an user from the database based on its id. This handler expects the id being passed in the route variable in the current request.

Types

This section is empty.

Jump to

Keyboard shortcuts

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