Documentation ¶
Index ¶
- func CORS(next fasthttp.RequestHandler) fasthttp.RequestHandler
- func CheckAuthentication(h fasthttp.RequestHandler) fasthttp.RequestHandler
- func CheckToken(next httprouter.Handle) httprouter.Handle
- func FullLogger(req fasthttp.RequestHandler) fasthttp.RequestHandler
- func HTTPCORS(w http.ResponseWriter, r *http.Request, _ httprouter.Params) httprouter.Handle
- func SecureHeaders(next httprouter.Handle) httprouter.Handle
- func SetHTTPLogging(condition bool)
- func TinyHTTPLogger(req httprouter.Handle) httprouter.Handle
- func TinyLogger(req fasthttp.RequestHandler) fasthttp.RequestHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CORS ¶
func CORS(next fasthttp.RequestHandler) fasthttp.RequestHandler
CORS middleware allows us to make requests to the seperate javascript client
func CheckAuthentication ¶
func CheckAuthentication(h fasthttp.RequestHandler) fasthttp.RequestHandler
CheckAuthentication looks for a cookie, given by the /register or /login routes. And finds the username in that jwt token.
func CheckToken ¶
func CheckToken(next httprouter.Handle) httprouter.Handle
CheckAuthentication looks for a cookie, given by the /register or /login routes. And finds the username in that jwt token.
func FullLogger ¶
func FullLogger(req fasthttp.RequestHandler) fasthttp.RequestHandler
FullLogger prints out most of the provided information to stdout FORMAT time [remote-addr] [http-version] [method] [url] [status] [response-time] [user-agent]
func HTTPCORS ¶
func HTTPCORS(w http.ResponseWriter, r *http.Request, _ httprouter.Params) httprouter.Handle
func SecureHeaders ¶
func SecureHeaders(next httprouter.Handle) httprouter.Handle
SecureHeaders adds some common headers for some security things.
func SetHTTPLogging ¶
func SetHTTPLogging(condition bool)
SetHTTPLogging sets the variable in this file to a given condition
func TinyHTTPLogger ¶
func TinyHTTPLogger(req httprouter.Handle) httprouter.Handle
TinyLogger prints a few pieces of information to stdout when a request happens. FORMAT: [method] [url] [status] [response-time]
func TinyLogger ¶
func TinyLogger(req fasthttp.RequestHandler) fasthttp.RequestHandler
TinyLogger prints a few pieces of information to stdout when a request happens. FORMAT: [method] [url] [status] [response-time]
Types ¶
This section is empty.