@@ -8,26 +8,26 @@ import (
88// Option is a functional option for configuring the API client.
99type Option func (* API ) error
1010
11- // HTTPClient accepts a custom *http.Client for making API calls.
12- func HTTPClient (client * http.Client ) Option {
11+ // WithHTTPClient accepts a custom *http.Client for making API calls.
12+ func WithHTTPClient (client * http.Client ) Option {
1313 return func (api * API ) error {
1414 api .httpClient = client
1515 return nil
1616 }
1717}
1818
19- // Headers allows you to set custom HTTP headers when making API calls (e.g. for
19+ // WithHeaders allows you to set custom HTTP headers when making API calls (e.g. for
2020// satisfying HTTP proxies, or for debugging).
21- func Headers (headers http.Header ) Option {
21+ func WithHeaders (headers http.Header ) Option {
2222 return func (api * API ) error {
2323 api .headers = headers
2424 return nil
2525 }
2626}
2727
28- // UsingRetryPolicy applies a non-default number of retries and min/max retry delays
28+ // WithRetryPolicy applies a non-default number of retries and min/max retry delays
2929// This will be used when the client exponentially backs off after errored requests
30- func UsingRetryPolicy (maxRetries int , minRetryDelaySecs int , maxRetryDelaySecs int ) Option {
30+ func WithRetryPolicy (maxRetries int , minRetryDelaySecs int , maxRetryDelaySecs int ) Option {
3131 // seconds is very granular for a minimum delay - but this is only in case of failure
3232 return func (api * API ) error {
3333 api .retryPolicy = RetryPolicy {
@@ -39,20 +39,20 @@ func UsingRetryPolicy(maxRetries int, minRetryDelaySecs int, maxRetryDelaySecs i
3939 }
4040}
4141
42- // UserAgent can be set if you want to send a software name and version for HTTP access logs.
42+ // WithUserAgent can be set if you want to send a software name and version for HTTP access logs.
4343// It is recommended to set it in order to help future Customer Support diagnostics
4444// and prevent collateral damage by sharing generic User-Agent string with abusive users.
4545// E.g. "my-software/1.2.3". By default generic Go User-Agent is used.
46- func UserAgent (userAgent string ) Option {
46+ func WithUserAgent (userAgent string ) Option {
4747 return func (api * API ) error {
4848 api .UserAgent = userAgent
4949 return nil
5050 }
5151}
5252
53- // UsingLogger can be set if you want to get log output from this API instance
53+ // WithLogger can be set if you want to get log output from this API instance
5454// By default no log output is emitted
55- func UsingLogger (logger Logger ) Option {
55+ func WithLogger (logger Logger ) Option {
5656 return func (api * API ) error {
5757 api .logger = logger
5858 return nil
0 commit comments