Documentation ¶
Index ¶
- func EscapeParams(params ...interface{}) []interface{}
- type BadRequest
- type Client
- func (client *Client) Get(ctx context.Context, response interface{}, path string, params interface{}, ...) error
- func (client *Client) GetRaw(ctx context.Context, path string, params interface{}, headers []*Header) (response []byte, err error)
- func (client *Client) GetRawMsgpack(ctx context.Context, response interface{}, path string, params interface{}, ...) error
- func (client *Client) Post(ctx context.Context, response interface{}, path string, params interface{}, ...) error
- type Header
- type InternalError
- type InvalidToken
- type NotFound
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EscapeParams ¶ added in v1.17.0
func EscapeParams(params ...interface{}) []interface{}
Helper function for correctly formatting and escaping URL path parameters. Used in the generated API client code.
Types ¶
type BadRequest ¶
type BadRequest error
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client manages the REST interface for a calling user.
func MakeClient ¶
MakeClient is the factory for constructing a Client for a given endpoint.
func MakeClientWithHeaders ¶
func MakeClientWithHeaders(address string, apiHeader, apiToken string, headers []*Header) (c *Client, err error)
MakeClientWithHeaders is the factory for constructing a Client for a given endpoint with additional user defined headers.
func (*Client) Get ¶
func (client *Client) Get(ctx context.Context, response interface{}, path string, params interface{}, headers []*Header) error
Get performs a GET request to the specific path against the server
func (*Client) GetRaw ¶ added in v1.5.1
func (client *Client) GetRaw(ctx context.Context, path string, params interface{}, headers []*Header) (response []byte, err error)
GetRaw performs a GET request to the specific path against the server and returns the raw body bytes.
func (*Client) GetRawMsgpack ¶
func (client *Client) GetRawMsgpack(ctx context.Context, response interface{}, path string, params interface{}, headers []*Header) error
GetRawMsgpack performs a GET request to the specific path against the server and returns the decoded messagepack response.
func (*Client) Post ¶
func (client *Client) Post(ctx context.Context, response interface{}, path string, params interface{}, headers []*Header, body interface{}) error
Post sends a POST request to the given path with the given body object. No query parameters will be sent if body is nil. response must be a pointer to an object as post writes the response there.
type InternalError ¶
type InternalError error
type InvalidToken ¶
type InvalidToken error