Documentation ¶
Index ¶
- func AddOptions(s string, opt interface{}) (string, error)
- func BasicAuth(username, password string) string
- func Bool(v bool) *bool
- func Int(v int) *int
- func RegisterDecoder(format string, fn DecoderFunc)
- func RegisterEncoder(format string, fn EncoderFunc)
- func String(v string) *string
- type Client
- func (c *Client) Decode(v interface{}, r io.Reader) error
- func (c *Client) Decoder(r io.Reader) (Decoder, error)
- func (c *Client) Delete(path string, input, output interface{}) (*http.Response, error)
- func (c *Client) Do(req *http.Request, output interface{}) (*http.Response, error)
- func (c *Client) Encode(v interface{}, w io.Writer) error
- func (c *Client) Encoder(w io.Writer) (Encoder, error)
- func (c *Client) Get(path string, output interface{}) (*http.Response, error)
- func (c *Client) NewRequest(meth string, path string, input interface{}) (*http.Request, error)
- func (c *Client) Post(path string, input, output interface{}) (*http.Response, error)
- func (c *Client) Put(path string, input, output interface{}) (*http.Response, error)
- type Decoder
- type DecoderFunc
- type Encoder
- type EncoderFunc
- type HTTPError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddOptions ¶
AddOptions adds the parameters in opt as URL query parameters to s. opt must be a struct whose fields may contain "url" tags.
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func Int ¶
Int is a helper routine that allocates a new int32 value to store v and returns a pointer to it, but unlike Int32 its argument value is an int.
func RegisterDecoder ¶
func RegisterDecoder(format string, fn DecoderFunc)
func RegisterEncoder ¶
func RegisterEncoder(format string, fn EncoderFunc)
Types ¶
type Client ¶
type Client struct { HTTPClient *http.Client Endpoint *url.URL Header http.Header Query url.Values EncoderFunc EncoderFunc DecoderFunc DecoderFunc }
Client type
func NewFromURL ¶
NewFromURL returns a Client with a configured endpoint from a url.URL and http.Client
func (*Client) NewRequest ¶
NewRequest returns a new http.Request object
type DecoderFunc ¶
type EncoderFunc ¶
Click to show internal directories.
Click to hide internal directories.