Documentation ¶
Overview ¶
Package controllers provides controller functions for interacting with the dynosurveys backend databases.
Index ¶
- Variables
- func CreateForm(w http.ResponseWriter, r *http.Request)
- func CreateUser(w http.ResponseWriter, r *http.Request)
- func FetchFormResponses(w http.ResponseWriter, r *http.Request)
- func FindOne(email, password string) map[string]interface{}
- func ListForms(w http.ResponseWriter, r *http.Request)
- func Login(w http.ResponseWriter, r *http.Request)
- func RecordFormResponse(w http.ResponseWriter, r *http.Request)
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
View Source
var Ctx = tmp
Ctx represents the MongoDB context
View Source
var MDB, _ = utils.NewMongoClient()
MDB represents the MongoDB client
View Source
var PDB = utils.NewPostgreClient()
PDB represents the PostgreSQL DB Client
Functions ¶
func CreateForm ¶
func CreateForm(w http.ResponseWriter, r *http.Request)
CreateForm creates a new form in the database
func CreateUser ¶
func CreateUser(w http.ResponseWriter, r *http.Request)
CreateUser creates a new user in the database
func FetchFormResponses ¶
func FetchFormResponses(w http.ResponseWriter, r *http.Request)
FetchFormResponses retrieves the responses of a form from the MongoDB database.
func ListForms ¶
func ListForms(w http.ResponseWriter, r *http.Request)
ListForms retrieves a list of forms from the forms database that match a particular user_id
func Login ¶
func Login(w http.ResponseWriter, r *http.Request)
Login attempts to log in a user and writes the response
func RecordFormResponse ¶
func RecordFormResponse(w http.ResponseWriter, r *http.Request)
RecordFormResponse stores the response of a form into the MongoDB database.
Types ¶
Click to show internal directories.
Click to hide internal directories.