Documentation
¶
Index ¶
- type JSONResponse
- func (r JSONResponse) WithCode(code string) JSONResponse
- func (r JSONResponse) WithData(data interface{}) JSONResponse
- func (r JSONResponse) WithErrorString(errorStr string) JSONResponse
- func (r JSONResponse) WithLatency(start time.Time) JSONResponse
- func (r JSONResponse) WithMessage(message string) JSONResponse
- func (r JSONResponse) WithResult(result interface{}) JSONResponse
- func (r JSONResponse) WithStatusCode(statusCode int) JSONResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JSONResponse ¶
type JSONResponse struct {
Data interface{} `json:"data,omitempty"`
Message string `json:"message,omitempty"`
Code string `json:"code,omitempty"`
StatusCode int `json:"status_code,omitempty"`
ErrorString string `json:"error,omitempty"`
Latency int64 `json:"latency,omitempty"`
Result interface{} `json:"result,omitempty"`
}
func NewJSONResponse ¶
func NewJSONResponse() JSONResponse
func (JSONResponse) WithCode ¶
func (r JSONResponse) WithCode(code string) JSONResponse
func (JSONResponse) WithData ¶
func (r JSONResponse) WithData(data interface{}) JSONResponse
func (JSONResponse) WithErrorString ¶
func (r JSONResponse) WithErrorString(errorStr string) JSONResponse
func (JSONResponse) WithLatency ¶
func (r JSONResponse) WithLatency(start time.Time) JSONResponse
func (JSONResponse) WithMessage ¶
func (r JSONResponse) WithMessage(message string) JSONResponse
func (JSONResponse) WithResult ¶
func (r JSONResponse) WithResult(result interface{}) JSONResponse
func (JSONResponse) WithStatusCode ¶
func (r JSONResponse) WithStatusCode(statusCode int) JSONResponse
Click to show internal directories.
Click to hide internal directories.