Documentation
¶
Index ¶
- Constants
- type Client
- func (r *Client) Delete(ctx context.Context, route string, params url.Values) error
- func (r *Client) Get(ctx context.Context, route string, params url.Values, output interface{}) error
- func (r *Client) Head(ctx context.Context, route string, params url.Values, ...) error
- func (r *Client) Patch(ctx context.Context, route string, input interface{}) error
- func (r *Client) Perform(ctx context.Context, verb string, route string, params url.Values, ...) error
- func (r *Client) Post(ctx context.Context, route string, params url.Values, input interface{}, ...) error
- func (r *Client) Put(ctx context.Context, route string, params url.Values, input interface{}, ...) error
Constants ¶
const BLANK_FORMAT = ""
const FORM_FORMAT = "application/x-www-form-urlencoded"
const HEAD_FORMAT = "head"
const JSON_FORMAT = "application/json"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
Client represents a HTTP REST API client requesting a configured endpoint.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, route string, params url.Values, output interface{}) error
Get an entity using route as base url then params as query parameters output as structure where to decode received JSON entity
func (*Client) Head ¶
func (r *Client) Head(ctx context.Context, route string, params url.Values, output map[string][]string) error
Head entity using route as base url then params as query parameters
func (*Client) Patch ¶
Patch an entity using route as base url input as structure to encode into JSON as a body
func (*Client) Post ¶
func (r *Client) Post(ctx context.Context, route string, params url.Values, input interface{}, output interface{}) error
Post an entity using route as base url then params as query parameters input as structure to encode into JSON as a body output as structure where to decode received JSON entity
func (*Client) Put ¶
func (r *Client) Put(ctx context.Context, route string, params url.Values, input interface{}, output interface{}) error
Put an entity using route as base url then params as query parameters input as structure to encode into JSON as a body output as structure where to decode received JSON entity