circle-info
Squadcast is now SolarWinds Incident Response

Options

Global Options

Global options are passed when initializing the SDK client and apply to all operations.

WithServerURL

WithServerURL allows providing an alternative server URL.

squadcastsdk.WithServerURL("https://api.example.com")

WithTemplatedServerURL

WithTemplatedServerURL allows providing an alternative server URL with templated parameters.

squadcastsdk.WithTemplatedServerURL("https://{host}:{port}", map[string]string{
    "host": "api.example.com",
    "port": "8080",
})

WithServerIndex

WithServerIndex allows the overriding of the default server by index.

squadcastsdk.WithServerIndex(1)

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.

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.

Last updated