Documentation
¶
Index ¶
- func IsMessagePackResponse(resp *http.Response) bool
- type Client
- func (c *Client) DoEntity(ctx context.Context, method, path string, reqBody any, respBody any, ...) error
- func (c *Client) DoEntityStream(ctx context.Context, method, path string, reqBody any, wireFormat string) (*http.Response, error)
- func (c *Client) DoJSON(ctx context.Context, method, path string, reqBody any, respBody any) error
- func (c *Client) DoStream(ctx context.Context, method, path string, reqBody any) (*http.Response, error)
- func (c *Client) LogResponses() bool
- func (c *Client) Logger() *log.Logger
- type Options
- type Signer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMessagePackResponse ¶ added in v0.3.0
IsMessagePackResponse reports whether a response advertises the entity MessagePack media type. It is shared with the stream iterator.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps an http.Client with helpers for Onyx API communication.
func (*Client) DoEntity ¶ added in v0.3.0
func (c *Client) DoEntity(ctx context.Context, method, path string, reqBody any, respBody any, wireFormat string) error
DoEntity executes an entity request in the configured wire format. A server may answer a MessagePack request with JSON; the actual response Content-Type selects the decoder.
func (*Client) DoEntityStream ¶ added in v0.3.0
func (c *Client) DoEntityStream(ctx context.Context, method, path string, reqBody any, wireFormat string) (*http.Response, error)
DoEntityStream starts an entity stream in the configured wire format.
func (*Client) DoStream ¶
func (c *Client) DoStream(ctx context.Context, method, path string, reqBody any) (*http.Response, error)
DoStream executes an HTTP request and returns the response for streaming consumption.
func (*Client) LogResponses ¶ added in v0.2.0
LogResponses reports whether response logging is enabled.
Click to show internal directories.
Click to hide internal directories.