Documentation
¶
Index ¶
- type Client
- func (c *Client) Delete(path string, params map[string][]string) (*Response, error)
- func (c *Client) DeleteWithContext(ctx context.Context, path string, params map[string][]string) (*Response, error)
- func (c *Client) Get(path string, params map[string][]string) (*Response, error)
- func (c *Client) GetWithContext(ctx context.Context, path string, params map[string][]string) (*Response, error)
- func (c *Client) IsReady(ctx context.Context) (bool, error)
- func (c *Client) Post(path string, params map[string][]string, body interface{}) (*Response, error)
- func (c *Client) PostWithContext(ctx context.Context, path string, params map[string][]string, body interface{}) (*Response, error)
- func (c *Client) Put(path string, params map[string][]string, body interface{}) (*Response, error)
- func (c *Client) PutWithContext(ctx context.Context, path string, params map[string][]string, body interface{}) (*Response, error)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Key-value pairs in an HTTP header. Headers http.Header // A parsed URL (technically a URI) URL *url.URL // contains filtered or unexported fields }
A simple client that will also handle http requests. Uses the net/http and net/url packages.
func New ¶
New
Creates a new client from the shared config.Client() struct. * @param conf: client configurations
func (*Client) Delete ¶
Delete
Makes a DELETE request to the client with a background context.Context(). * @param path: client path that request will send to * @param parameters: query parameters
func (*Client) DeleteWithContext ¶
func (c *Client) DeleteWithContext(ctx context.Context, path string, params map[string][]string) (*Response, error)
DeleteWithContext
Makes a DELETE request to the client with any passed in context.Context(). * @param ctx: context used to handle any cancellations * @param path: client path that request will send to * @param parameters: query parameters
func (*Client) Get ¶
Get
Makes a GET request to the client with a background context.Context(). * @param path: client path that request will send to * @param parameters: query parameters
func (*Client) GetWithContext ¶
func (c *Client) GetWithContext(ctx context.Context, path string, params map[string][]string) (*Response, error)
GetWithContext
Makes a GET request to the client with any passed in context.Context(). * @param ctx: context used to handle any cancellations * @param path: client path that request will send to * @param parameters: query parameters
func (*Client) IsReady ¶
IsReady
Uses the clients health endpoint to determine if its up and running. * @param path: client path that request will send to
func (*Client) Post ¶
Post
Makes a POST request to the client with any passed in context.Context(). * @param path: client path that request will send to * @param parameters: query parameters * @param body: request body
func (*Client) PostWithContext ¶
func (c *Client) PostWithContext(ctx context.Context, path string, params map[string][]string, body interface{}) (*Response, error)
PostWithContext
Makes a POST request to the client with any passed in context.Context(). * @param ctx: context used to handle any cancellations * @param path: client path that request will send to * @param parameters: query parameters * @param body: request body
func (*Client) Put ¶
Put
Makes a PUT request to the client with any passed in context.Context(). * @param path: client path that request will send to * @param parameters: query parameters * @param body: request body
func (*Client) PutWithContext ¶
func (c *Client) PutWithContext(ctx context.Context, path string, params map[string][]string, body interface{}) (*Response, error)
PutWithContext
Makes a PUT request to the client with any passed in context.Context(). * @param ctx: context used to handle any cancellations * @param path: client path that request will send to * @param parameters: query parameters * @param body: request body
type Response ¶
type Response struct { // http status test. Example "200 OK" Status string // http status code. Example 200 StatusCode int // the request that was received by a server or to be sent by a client Request *http.Request // contains filtered or unexported fields }
The response from an HTTP request.
func (*Response) GetBodyBytes ¶
GetBodyBytes
Reads the response body i/o and converts it to a byte array.
func (*Response) GetBodyString ¶
GetBodyString
Parses the response body i/o interface into a string.
Click to show internal directories.
Click to hide internal directories.