Documentation
¶
Index ¶
- Constants
- func DealJsonMarshal(w http.ResponseWriter, r *http.Request, v interface{}) []byte
- func SendJsonResponse(w http.ResponseWriter, r *http.Request, response JsonResponse)
- func SendResponseInternalError(w http.ResponseWriter, r *http.Request, err error, code int)
- func SendResponseOK(w http.ResponseWriter, r *http.Request)
- func SendStringResponse(w http.ResponseWriter, r *http.Request, response StringResponse)
- func WriteJsonMarshal(w http.ResponseWriter, r *http.Request, v interface{})
- type Dealer
- type Handler
- type JsonResponse
- type StringResponse
Constants ¶
View Source
const ( HttpResponseTrue = 0 HttpResponseFalse = 1 )
Variables ¶
This section is empty.
Functions ¶
func DealJsonMarshal ¶
func DealJsonMarshal(w http.ResponseWriter, r *http.Request, v interface{}) []byte
func SendJsonResponse ¶
func SendJsonResponse(w http.ResponseWriter, r *http.Request, response JsonResponse)
func SendResponseOK ¶
func SendResponseOK(w http.ResponseWriter, r *http.Request)
func SendStringResponse ¶
func SendStringResponse(w http.ResponseWriter, r *http.Request, response StringResponse)
func WriteJsonMarshal ¶
func WriteJsonMarshal(w http.ResponseWriter, r *http.Request, v interface{})
Types ¶
type Dealer ¶
type Dealer struct { Header func(w http.ResponseWriter) `json:"header"` Handlers []Handler `json:"handlers"` }
type Handler ¶
type Handler interface {
Dealer(w http.ResponseWriter, r *http.Request) (http.ResponseWriter, *http.Request, error)
}
type JsonResponse ¶
type JsonResponse struct { Status int `json:"status"` Message json.RawMessage `json:"message"` Code int `json:"code"` }
type StringResponse ¶
type StringResponse struct { Status int `json:"status"` Message string `json:"message"` Code int `json:"code"` }
func (StringResponse) Send ¶
func (res StringResponse) Send(w http.ResponseWriter, r *http.Request)
Click to show internal directories.
Click to hide internal directories.