File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
tools/config/go-templates Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ func NewClient(modifiers ...ClientModifier) (*APIClient, error) {
4444// ClientModifiers lets you create function that controls configuration before creating client.
4545type ClientModifier func (* Configuration ) error
4646
47+ // UseDigestAuth provides Digest authentication for Go SDK.
48+ // UseDigestAuth is provided as helper to create a default HTTP client that supports HTTP Digest authentication.
49+ // Warning: any previously set httpClient will be overwritten. To fully customize HttpClient use UseHTTPClient method.
4750func UseDigestAuth (apiKey , apiSecret string ) ClientModifier {
4851 return func (c * Configuration ) error {
4952 transport := digest .NewTransport (apiKey , apiSecret )
@@ -59,6 +62,12 @@ func UseDigestAuth(apiKey, apiSecret string) ClientModifier {
5962// Advanced modifiers.
6063
6164// UseHTTPClient set custom http client implementation.
65+ //
66+ // Warning: UseHTTPClient overrides any previously set httpClient including the one set by UseDigestAuth.
67+ // To set a custom http client with HTTP diggest support use:
68+ //
69+ // transport := digest.NewTransportWithHTTPRoundTripper(apiKey, apiSecret, yourHttpTransport)
70+ // client := UseHTTPClient(transport.Client())
6271func UseHTTPClient (client * http.Client ) ClientModifier {
6372 return func (c * Configuration ) error {
6473 c .HTTPClient = client
Original file line number Diff line number Diff line change @@ -44,6 +44,10 @@ func NewClient(modifiers ...ClientModifier) (*APIClient, error) {
4444// ClientModifiers lets you create function that controls configuration before creating client.
4545type ClientModifier func(*Configuration) error
4646
47+
48+ // UseDigestAuth provides Digest authentication for Go SDK.
49+ // UseDigestAuth is provided as helper to create a default HTTP client that supports HTTP Digest authentication.
50+ // Warning: any previously set httpClient will be overwritten. To fully customize HttpClient use UseHTTPClient method.
4751func UseDigestAuth(apiKey, apiSecret string) ClientModifier {
4852 return func(c *Configuration) error {
4953 transport := digest.NewTransport(apiKey, apiSecret)
@@ -58,7 +62,14 @@ func UseDigestAuth(apiKey, apiSecret string) ClientModifier {
5862
5963// Advanced modifiers.
6064
61- // UseHTTPClient set custom http client implementation.
65+
66+ // UseHTTPClient set custom http client implementation.
67+ //
68+ // Warning: UseHTTPClient overrides any previously set httpClient including the one set by UseDigestAuth.
69+ // To set a custom http client with HTTP diggest support use:
70+ //
71+ // transport := digest.NewTransportWithHTTPRoundTripper(apiKey, apiSecret, yourHttpTransport)
72+ // client := UseHTTPClient(transport.Client())
6273func UseHTTPClient(client *http.Client) ClientModifier {
6374 return func(c *Configuration) error {
6475 c.HTTPClient = client
You can’t perform that action at this time.
0 commit comments