Documentation ¶
Overview ¶
Package rest provides convenience and sensible defaults for some low level http client
Index ¶
- Variables
- func NewHTTPError(code int, msg string) error
- type Client
- func (c Client) GetJSON(ctx context.Context, req *HTTPRequest, resp any) error
- func (c Client) GetXML(ctx context.Context, req *HTTPRequest, resp any) error
- func (c Client) PostJSON(ctx context.Context, req *HTTPRequest, resp any) error
- func (c Client) PostXML(ctx context.Context, req HTTPRequest, resp any) error
- func (c Client) PutJSON(ctx context.Context, req *HTTPRequest, resp any) error
- func (c Client) PutXML(ctx context.Context, req *HTTPRequest, resp any) error
- type HTTPClientJSONInterface
- type HTTPClientXMLInterface
- type HTTPError
- type HTTPRequest
Constants ¶
This section is empty.
Variables ¶
View Source
var TimeoutError = errors.New("client request timeout")
Functions ¶
func NewHTTPError ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func Create ¶
func Create(config configs.HTTPClientConfig) *Client
type HTTPClientJSONInterface ¶
type HTTPClientJSONInterface interface { GetJSON(ctx context.Context, req *HTTPRequest, resp any) error PostJSON(ctx context.Context, req *HTTPRequest, resp any) error PutJSON(ctx context.Context, req *HTTPRequest, resp any) error }
HTTPClientJSONInterface interface for client with JSON responses
type HTTPClientXMLInterface ¶
type HTTPClientXMLInterface interface { GetXML(ctx context.Context, req *HTTPRequest, resp any) error PutXML(ctx context.Context, req *HTTPRequest, resp any) error PostXML(ctx context.Context, req *HTTPRequest, resp any) error }
HTTPClientXMLInterface interface for client with XML responses
Click to show internal directories.
Click to hide internal directories.