Documentation ¶
Index ¶
- Constants
- func Delay(ctx context.Context, delay time.Duration) error
- func ExtractModuleName(clientName string) (string, string, error)
- func RetryAfter(resp *http.Response) time.Duration
- func TypeOfT[T any]() reflect.Type
- func ValidateModVer(moduleVersion string) error
- type CtxIncludeResponseKey
- type CtxWithHTTPHeaderKey
- type CtxWithRetryOptionsKey
- type TransportFunc
Constants ¶
const ( ContentTypeAppJSON = "application/json" ContentTypeAppXML = "application/xml" )
const ( HeaderAuthorization = "Authorization" HeaderAuxiliaryAuthorization = "x-ms-authorization-auxiliary" HeaderAzureAsync = "Azure-AsyncOperation" HeaderContentLength = "Content-Length" HeaderContentType = "Content-Type" HeaderLocation = "Location" HeaderOperationLocation = "Operation-Location" HeaderRetryAfter = "Retry-After" HeaderUserAgent = "User-Agent" HeaderWWWAuthenticate = "WWW-Authenticate" HeaderXMSClientRequestID = "x-ms-client-request-id" )
const ( // Module is the name of the calling module used in telemetry data. Module = "azcore" // Version is the semantic version (see http://semver.org) of this module. Version = "v1.7.0" )
const BearerTokenPrefix = "Bearer "
Variables ¶
This section is empty.
Functions ¶
func ExtractModuleName ¶ added in v1.6.1
ExtractModuleName returns "module", "package.Client" from "module/package.Client" or "package", "package.Client" from "package.Client" when there's no "module/" prefix. If clientName is malformed, an error is returned.
func RetryAfter ¶
RetryAfter returns non-zero if the response contains a Retry-After header value.
func ValidateModVer ¶ added in v1.3.0
ValidateModVer verifies that moduleVersion is a valid semver 2.0 string.
Types ¶
type CtxIncludeResponseKey ¶ added in v0.22.0
type CtxIncludeResponseKey struct{}
CtxIncludeResponseKey is used as a context key for retrieving the raw response.
type CtxWithHTTPHeaderKey ¶
type CtxWithHTTPHeaderKey struct{}
CtxWithHTTPHeaderKey is used as a context key for adding/retrieving http.Header.
type CtxWithRetryOptionsKey ¶
type CtxWithRetryOptionsKey struct{}
CtxWithRetryOptionsKey is used as a context key for adding/retrieving RetryOptions.
type TransportFunc ¶ added in v1.0.0
TransportFunc is a helper to use a first-class func to satisfy the Transporter interface.