Documentation
¶
Index ¶
- Variables
- func ErrCode(err error) int
- func JSON(ctx context.Context, url string, headers map[string]string, ...) error
- func MsgPack(ctx context.Context, url string, headers map[string]string, ...) error
- func Raw(ctx context.Context, url string, headers map[string]string, limit int64) ([]byte, error)
- type HTTPError
- type Request
- func (r *Request) Body(raw []byte) *Response
- func (r *Request) DecodeJSON(v interface{}) error
- func (r *Request) Discard() error
- func (r *Request) Do() *Response
- func (r *Request) File(key, fname string, raw []byte) *Response
- func (r *Request) Form(method string, v url.Values) *Response
- func (r *Request) Header(key, value string) *Request
- func (r *Request) Headers(h map[string]string) *Request
- func (r *Request) JSON(data interface{}) *Response
- func (r *Request) Limit(l int64) *Request
- func (r *Request) Method(m string) *Request
- func (r *Request) Raw() ([]byte, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func JSON ¶
func JSON(ctx context.Context, url string, headers map[string]string, req, resp interface{}, limit int64) error
JSON is a JSON-based request/response helper.
func MsgPack ¶
Types ¶
type HTTPError ¶
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) DecodeJSON ¶
DecodeJSON is a convenience method for GET requests and calls Response.DecodeJSON directly.
func (*Request) Do ¶
TODO: this is misleading because "Do" doesn't actually perform the request
Click to show internal directories.
Click to hide internal directories.