Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( PollInterval = time.Second PollRetries = 10 )
View Source
var ErrNotFound = errors.New("receipt not found")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Fetch ¶
Fetch a receipt from the receipt API. Returns ErrNotFound if the API responds with http.StatusNotFound.
type Option ¶
type Option func(c *Client)
func WithCodec ¶
func WithCodec(codec transport.ResponseDecoder) Option
func WithHTTPClient ¶
type PollOption ¶
type PollOption func(opt *pollConfig)
func WithInterval ¶
func WithInterval(interval time.Duration) PollOption
WithInterval configures the time to wait between poll requests. The default is PollInterval.
func WithRetries ¶
func WithRetries(n int) PollOption
WithRetries configures the maximum number of times that Poll will attempt to fetch a receipt. The default is PollRetries requests. Set it to -1 to poll until a non-404 response is encountered.
Click to show internal directories.
Click to hide internal directories.