Documentation
¶
Overview ¶
Package client is a small HTTP client for fpga-gzipd. It supports both Unix-domain and TCP endpoints and streams request/response bodies without buffering the compressed object in memory.
Index ¶
- type Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) Compress(ctx context.Context, src io.Reader, inputSize int64, dst io.Writer) (Result, error)
- func (c *Client) CompressAlgorithm(ctx context.Context, algorithm firmware.Algorithm, src io.Reader, ...) (Result, error)
- func (c *Client) Health(ctx context.Context) error
- type Option
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to one fpga-gzipd endpoint.
func NewHTTP ¶
NewHTTP creates a client from an HTTP base URL. If hc is nil, a client with a default transport is used. This is useful for tests and for callers that already configure TLS, proxies or connection pooling.
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
CloseIdleConnections releases pooled TCP or Unix transport connections.
func (*Client) Compress ¶
func (c *Client) Compress(ctx context.Context, src io.Reader, inputSize int64, dst io.Writer) (Result, error)
Compress streams exactly inputSize bytes from src to fpga-gzipd and copies the gzip response to dst. The caller must provide the complete input size; a non-rewindable reader is supported.
func (*Client) CompressAlgorithm ¶ added in v0.0.3
func (c *Client) CompressAlgorithm(ctx context.Context, algorithm firmware.Algorithm, src io.Reader, inputSize int64, dst io.Writer) (Result, error)
CompressAlgorithm checks image selection and the final verification trailer. A late DMA or integrity error cannot be mistaken for successful HTTP output.