Versions in this module Expand all Collapse all v0 v0.1.0 Nov 10, 2023 Changes in this version + var ErrBody = errors.New("must set []byte, io.Reader, or string for the body") + type Client struct + func Must(base string, opts ...Option) *Client + func New(u *url.URL, opts ...Option) *Client + func (c *Client) Do(ctx context.Context, r Request, v interface{}, ...) (err error) + func (c *Client) Name() string + type Error struct + Code int + Err error + Message string + Name string + func (e *Error) Error() string + func (e *Error) Is(err error) bool + func (e *Error) Unwrap() error + type Option func(*Client) + func WithDecode(d func(data []byte, v interface{}) error) Option + func WithHeaders(h ...Value) Option + func WithLogFunc(...) Option + func WithName(n string) Option + func WithTimeout(t time.Duration) Option + func WithTransport(t http.RoundTripper) Option + type Request struct + func DELETE(handler string, args ...interface{}) Request + func GET(handler string, args ...interface{}) Request + func NewRequest(method string) Request + func POST(handler string, args ...interface{}) Request + func PUT(handler string, args ...interface{}) Request + func (r Request) Body() (io.Reader, error) + func (r Request) HTTP(ctx context.Context) (*http.Request, error) + func (r Request) Handler() string + func (r Request) Method() string + func (r Request) ParseURL() (*url.URL, error) + func (r Request) RawBody() interface{} + func (r Request) URI() string + func (r Request) WithBase(u *url.URL) Request + func (r Request) WithBody(b interface{}, encoder func(v interface{}) (io.Reader, error), ...) Request + func (r Request) WithErrorHandler(h func(statusCode int, b []byte) error) Request + func (r Request) WithHeader(value ...Value) Request + func (r Request) WithJSONBody(b interface{}) Request + func (r Request) WithPath(path string) Request + func (r Request) WithPathf(path string, args ...interface{}) Request + func (r Request) WithQuery(value ...Value) Request + type Value func(values) + func Int(key string, value int) Value + func Int64(key string, value int64) Value + func Intp(key string, value *int) Value + func String(key, value string) Value + func Stringp(key string, value *string) Value + func Values(val map[string][]string) Value