# Packages
No description provided by the author
# Functions
JSONBody encodes arbitrary interface value as JSON string.
NewClient constructs a new resin.io client all HTTP requests are done via provided.
NewRequest creates HTTP preconfigured with resinio params.
NewRequestFactory is factory function to capture some high level base params Usage example:
NewRequest = api.NewRequestFactory( api.WithHostURL("https://example.com"), WithAuthToken(token), ) req, err := NewRequest("GET", "/orders", nil).
WithBackOff configures backoff factory.
WithBaseURL assigns a host and scheme to request URL.
WithConstantBackOff configures backoff factory.
WithContext binds context to request.
WithExpectStatus watch response status and returns StatusError in case expections are not met.
WithExponentialBackOff configures backoff factory.
WithHTTPClient sets http cloent to make requests.
WithMaxRetries configures how many retries to make make sure you setup bsome backoff factory function before.
WithNotify allows to setup external notify callback.
WithRetry wraps http request executor function with provided backoff policy.
WithRetryNotify wraps http request executor function with provided backoff policy and report error on each unsuccessful attempt.
XMLBody encodes arbitrary interface value as XML.
# Structs
Client for resin.io service.
StatusError incapsulate HTTP error with unexpected status code.
# Type aliases
ClientOptionFunc is functional type to configure client.
DoFunc is do-http-request function type.
InterceptDoFunc is function type for do-http-request intercepted calls.
NewBackOffFunc is factory function type to pass to WithRetryNotify interceptor.
NewRequestFunc new request signature.
RequestOptionFunc visitor to configure request Usage example:
func WithAuthToken(token string) RequestOptionFunc { return func(req *http.Request) (*http.Request, error) { req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token)) return req, nil } }.