Documentation ¶
Index ¶
- func Cors() func(next http.Handler) http.Handler
- func LogRequest() func(next http.Handler) http.Handler
- func WriteErrorJsonResponse(w http.ResponseWriter, statusCode int, message string)
- func WriteJsonResponse(w http.ResponseWriter, statusCode int, apiResp ApiResponse)
- func WriteOKJsonResponse(w http.ResponseWriter, statusCode int)
- func WritePlainTextResponse(w http.ResponseWriter, statusCode int, message []byte)
- func WriteResponseBytes(w http.ResponseWriter, contentType string, statusCode int, message []byte)
- type ApiResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogRequest ¶
LogRequest a small middleware function which logs request details
func WriteErrorJsonResponse ¶
func WriteErrorJsonResponse(w http.ResponseWriter, statusCode int, message string)
func WriteJsonResponse ¶
func WriteJsonResponse(w http.ResponseWriter, statusCode int, apiResp ApiResponse)
func WriteOKJsonResponse ¶
func WriteOKJsonResponse(w http.ResponseWriter, statusCode int)
func WritePlainTextResponse ¶
func WritePlainTextResponse(w http.ResponseWriter, statusCode int, message []byte)
func WriteResponseBytes ¶
func WriteResponseBytes(w http.ResponseWriter, contentType string, statusCode int, message []byte)
Types ¶
type ApiResponse ¶
Click to show internal directories.
Click to hide internal directories.