Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseJsonBody ¶
func ParseJsonBody(r io.ReadCloser, data interface{}) porterr.IError
Прочитать тело дескриптор запроса
func SendJson ¶
func SendJson(writer http.ResponseWriter, httpCode int, data interface{})
Sent json into http writer
Types ¶
type JsonResponse ¶
type JsonResponse struct {
// HTTP code
HttpCode int `json:"-"`
// Message information
Message interface{} `json:"message,omitempty"`
// Body
Data interface{} `json:"data,omitempty"`
// Meta information
Meta interface{} `json:"meta,omitempty"`
// Error information
Error interface{} `json:"error,omitempty"`
}
Json response struct
func NewErrorJsonResponse ¶
func NewErrorJsonResponse(e porterr.IError) *JsonResponse
New Json Response with error
func NewOkJsonResponse ¶
func NewOkJsonResponse(message interface{}, data interface{}, meta interface{}) *JsonResponse
New Json Response without error
Click to show internal directories.
Click to hide internal directories.