Documentation ¶
Index ¶
- type APIError
- type APIPage
- type APIPageResponse
- type APIResponse
- type BaseAPIResponse
- type DumpResponseWriter
- func (w *DumpResponseWriter) Header() http.Header
- func (w *DumpResponseWriter) OnData(fn func(data jsoniter.Any)) (int, error)
- func (w *DumpResponseWriter) Unmarshal(model BaseAPIResponse) (err error)
- func (w *DumpResponseWriter) Write(b []byte) (int, error)
- func (w *DumpResponseWriter) WriteHeader(statusCode int)
- type LoopPageProxy
- type Opt
- type Page
- type PageItems
- type PageQuery
- type Proxy
- type Request
- type Response
- type TCMErrorResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type APIPage ¶
type APIPage struct { Items *gojson.RawMessage `json:"items,omitempty"` TotalCount int `json:"total_count"` }
type APIPageResponse ¶
type APIPageResponse struct { // result code ResultCode int `json:"result_code,omitempty"` // err message Msg string `json:"message,omitempty"` Data APIPage `json:"data"` }
func (APIPageResponse) Code ¶
func (p APIPageResponse) Code() int
func (APIPageResponse) Message ¶
func (p APIPageResponse) Message() string
func (APIPageResponse) RawData ¶
func (p APIPageResponse) RawData() *gojson.RawMessage
func (APIPageResponse) SetData ¶
func (p APIPageResponse) SetData(data interface{})
type APIResponse ¶
type APIResponse struct { // result code ResultCode int `json:"result_code,omitempty"` // err message Msg string `json:"message,omitempty"` // return data,optional Raw *gojson.RawMessage `json:"data,omitempty"` Data interface{} `json:"-"` }
APIResponse - API
func (APIResponse) Code ¶
func (a APIResponse) Code() int
func (APIResponse) Message ¶
func (a APIResponse) Message() string
func (APIResponse) RawData ¶
func (a APIResponse) RawData() *gojson.RawMessage
func (APIResponse) SetData ¶
func (a APIResponse) SetData(data interface{})
type BaseAPIResponse ¶
type BaseAPIResponse interface { Code() int Message() string RawData() *gojson.RawMessage SetData(data interface{}) }
type DumpResponseWriter ¶
type DumpResponseWriter struct { Status int Body bytes.Buffer // contains filtered or unexported fields }
func NewDumpResponseWriter ¶
func NewDumpResponseWriter() *DumpResponseWriter
func (*DumpResponseWriter) Header ¶
func (w *DumpResponseWriter) Header() http.Header
func (*DumpResponseWriter) OnData ¶
func (w *DumpResponseWriter) OnData(fn func(data jsoniter.Any)) (int, error)
func (*DumpResponseWriter) Unmarshal ¶
func (w *DumpResponseWriter) Unmarshal(model BaseAPIResponse) (err error)
func (*DumpResponseWriter) WriteHeader ¶
func (w *DumpResponseWriter) WriteHeader(statusCode int)
type LoopPageProxy ¶
type LoopPageProxy struct {
// contains filtered or unexported fields
}
func NewLoopPageProxy ¶
func NewLoopPageProxy(f func(gojson.RawMessage) ([]interface{}, error), proxyOpts ...Opt) *LoopPageProxy
func (*LoopPageProxy) LastWriter ¶
func (l *LoopPageProxy) LastWriter() DumpResponseWriter
func (*LoopPageProxy) ResponseStatus ¶
func (l *LoopPageProxy) ResponseStatus() (status, resultCode int, msg string)
type Page ¶
type Page struct { Items interface{} `json:"items"` TotalCount int `json:"total_count"` }
type Proxy ¶
type TCMErrorResponse ¶
Click to show internal directories.
Click to hide internal directories.