controllers

package
v0.0.0-...-2b44ddc Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnswerQuestion

func AnswerQuestion(w http.ResponseWriter, r *http.Request)

func ArbitraryJSON

func ArbitraryJSON(w http.ResponseWriter, value interface{}, statusCode int)

ArbitraryJSON takes an interface value and a statuscode and writes it to a given http.ResponseWriter

func CreateCategory

func CreateCategory(w http.ResponseWriter, r *http.Request)

func CreateQuestion

func CreateQuestion(w http.ResponseWriter, r *http.Request)

func DeleteCategory

func DeleteCategory(w http.ResponseWriter, r *http.Request)

func DeleteQuestion

func DeleteQuestion(w http.ResponseWriter, r *http.Request)

func DeleteUser

func DeleteUser(w http.ResponseWriter, r *http.Request)

func EditCategory

func EditCategory(w http.ResponseWriter, r *http.Request)

func EditQuestion

func EditQuestion(w http.ResponseWriter, r *http.Request)

func GetRandomQuestion

func GetRandomQuestion(w http.ResponseWriter, r *http.Request)

func GetSingleQuestion

func GetSingleQuestion(w http.ResponseWriter, r *http.Request)

func LoginUser

func LoginUser(w http.ResponseWriter, r *http.Request)

func RegisterUser

func RegisterUser(w http.ResponseWriter, r *http.Request)

func ShowAllCategories

func ShowAllCategories(w http.ResponseWriter, r *http.Request)

func ShowAllQuestions

func ShowAllQuestions(w http.ResponseWriter, r *http.Request)

func ShowAllUser

func ShowAllUser(w http.ResponseWriter, r *http.Request)

Types

type Response

type Response map[string]interface{}

func NewResponse

func NewResponse(success bool, message string, codes ...int) Response

func (Response) Attr

func (r Response) Attr(key string, value interface{}) Response

func (Response) JSON

func (r Response) JSON(w http.ResponseWriter, statusCode ...int)

JSON marshals the Response struct to a JSON string and sets the HTTP Statuscode

Jump to

Keyboard shortcuts

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