Documentation ¶
Index ¶
- type ExportFile
- type JSON
- func (jr *JSON) BadRequest(err error) *JSON
- func (jr *JSON) ErrorChecking(r *http.Request) bool
- func (jr *JSON) Export(fileName string, content *bytes.Buffer) *JSON
- func (jr *JSON) ForbiddenResource(err error) *JSON
- func (jr *JSON) InternalServerError(err error) *JSON
- func (jr *JSON) Send(w http.ResponseWriter)
- func (jr *JSON) SetCode(code int) *JSON
- func (jr *JSON) SetData(data interface{}) *JSON
- func (jr *JSON) SetError(errCode int, err error) *JSON
- func (jr *JSON) SetMessage(msg string) *JSON
- func (jr *JSON) Success(data interface{}) *JSON
- func (jr *JSON) Unauthorized(err error) *JSON
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExportFile ¶
type JSON ¶
type JSON struct { Code int `json:"code"` Message string `json:"message"` MessageDesc string `json:"description,omitempty"` Error error `json:"-"` Data interface{} `json:"data,omitempty"` Latency float64 `json:"latency"` TraceId string `json:"trace_id,omitempty"` ExportFile *ExportFile `json:"-"` }
func (*JSON) BadRequest ¶
func (*JSON) ForbiddenResource ¶
func (*JSON) InternalServerError ¶
func (*JSON) Send ¶
func (jr *JSON) Send(w http.ResponseWriter)
func (*JSON) SetMessage ¶
func (*JSON) Unauthorized ¶
Click to show internal directories.
Click to hide internal directories.