Options - Go SDK
The Go SDK and docs are currently in beta. Report issues on GitHub.
Global Options
Global options are passed when initializing the SDK client and apply to all operations.
WithServerURL
WithServerURL allows providing an alternative server URL.
WithTemplatedServerURL
WithTemplatedServerURL allows providing an alternative server URL with templated parameters.
WithServer
WithServer allows the overriding of the default server by name.
WithClient
WithClient allows the overriding of the default HTTP client used by the SDK.
WithSecurity
WithSecurity configures the SDK to use the provided security details.
WithSecuritySource
WithSecuritySource configures the SDK to invoke the provided function on each method call to determine authentication.
WithHTTPReferer
WithHTTPReferer allows setting the HTTPReferer parameter for all supported operations.
WithXTitle
WithXTitle allows setting the XTitle parameter for all supported operations.
WithRetryConfig
WithRetryConfig allows setting the default retry configuration used by the SDK for all supported operations.
WithTimeout
WithTimeout sets the default request timeout for all operations.
Per-Method Options
Per-method options are passed as the last argument to individual methods and override any global settings for that request.
WithServerURL
WithServerURL allows providing an alternative server URL for a single request.
WithTemplatedServerURL
WithTemplatedServerURL allows providing an alternative server URL with templated parameters for a single request.
WithRetries
WithRetries allows customizing the default retry configuration for a single request.
WithOperationTimeout
WithOperationTimeout allows setting the request timeout for a single request.
WithSetHeaders
WithSetHeaders allows setting custom headers on a per-request basis. If the request already contains headers matching the provided keys, they will be overwritten.
WithURLOverride
WithURLOverride allows overriding the default URL for an operation.
WithAcceptHeaderOverride
WithAcceptHeaderOverride allows overriding the Accept header for operations that support multiple response content types.