Documentation
¶
Index ¶
- Constants
- type JSend
- func Error(message string) *JSend
- func ErrorCode(message string, code int) *JSend
- func ErrorCodeWithData(message string, code int, data interface{}) *JSend
- func ErrorData(message string, data interface{}) *JSend
- func Fail(data interface{}) *JSend
- func Read(r io.Reader) (*JSend, error)
- func Receive(r *http.Response) (*JSend, error)
- func Success(data interface{}) *JSend
Constants ¶
View Source
const ( StatusSuccess = "success" StatusFail = "fail" StatusError = "error" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSend ¶
type JSend struct {
Status string `json:"status"`
Data interface{} `json:"data,omitempty"`
Message string `json:"message,omitempty"`
Code int `json:"code,omitempty"`
}
func ErrorCodeWithData ¶
func (*JSend) SendFormatted ¶
func (jsend *JSend) SendFormatted(w http.ResponseWriter) error
Click to show internal directories.
Click to hide internal directories.