Documentation
¶
Index ¶
- func CoffeeGET(w http.ResponseWriter, _ *http.Request) *apiError.Error
- func CreateTestPOST(w http.ResponseWriter, _ *http.Request) *apiError.Error
- func ErrorHandler(w http.ResponseWriter, r *http.Request, err *apiError.Error)
- func ExtractCSVData(v interface{}) string
- func ExtractCSVHeaders(v interface{}) string
- func Handle(handler APIHandler) http.HandlerFunc
- func Info(w http.ResponseWriter, _ *http.Request) *apiError.Error
- func JSONHandler(w http.ResponseWriter, r *http.Request, data interface{}, ...)
- func OKTestPOST(w http.ResponseWriter, _ *http.Request) *apiError.Error
- func Ping(w http.ResponseWriter, _ *http.Request) *apiError.Error
- func SendCSVResponse(w http.ResponseWriter, fileNamePrefix string, csv *bytes.Buffer) *apiError.Error
- func SendCSVResponseFromString(w http.ResponseWriter, fileNamePrefix string, csvStr *string) *apiError.Error
- func SendCSVResponseWithFileName(w http.ResponseWriter, fileName string, csvStr *string) *apiError.Error
- func SendDataResponse(w http.ResponseWriter, data interface{}, pi *pageInfo.Response, code int) *apiError.Error
- func SendErrCodeResponse(w http.ResponseWriter, customCode, code int) *apiError.Error
- func SendHTMLResponse(w http.ResponseWriter, body []byte) *apiError.Error
- func SendJSONResponse(w http.ResponseWriter, body interface{}) *apiError.Error
- func SendMsgResponse(w http.ResponseWriter, msg string, code int) *apiError.Error
- func SendNoContent(w http.ResponseWriter) *apiError.Error
- func SendRedirectResponse(w http.ResponseWriter, location string, statusCode int) *apiError.Error
- func SendSuccessResponse(w http.ResponseWriter, isCreate bool) *apiError.Error
- type APIHandler
- type DResponse
- type ErrorResp
- type InfoResp
- type MResponse
- type Response
- type SResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateTestPOST ¶
func ErrorHandler ¶
ErrorHandler returns a httprouter handler
func ExtractCSVData ¶
func ExtractCSVData(v interface{}) string
func ExtractCSVHeaders ¶
func ExtractCSVHeaders(v interface{}) string
func Handle ¶ added in v1.1.3
func Handle(handler APIHandler) http.HandlerFunc
func JSONHandler ¶
func OKTestPOST ¶
func SendCSVResponse ¶
func SendDataResponse ¶
func SendErrCodeResponse ¶
func SendErrCodeResponse(w http.ResponseWriter, customCode, code int) *apiError.Error
func SendHTMLResponse ¶
func SendHTMLResponse(w http.ResponseWriter, body []byte) *apiError.Error
func SendJSONResponse ¶
func SendJSONResponse(w http.ResponseWriter, body interface{}) *apiError.Error
func SendMsgResponse ¶
func SendNoContent ¶
func SendNoContent(w http.ResponseWriter) *apiError.Error
func SendRedirectResponse ¶
func SendSuccessResponse ¶
func SendSuccessResponse(w http.ResponseWriter, isCreate bool) *apiError.Error
Types ¶
type APIHandler ¶
APIHandler a string making it easy to handle errors
func (APIHandler) Handle ¶
func (h APIHandler) Handle() http.HandlerFunc
Handle returns a httprouter handler
Source Files
¶
Click to show internal directories.
Click to hide internal directories.