shared

package
v1.8.0-beta.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeAppJSON   = "application/json"
	ContentTypeAppXML    = "application/xml"
	ContentTypeTextPlain = "text/plain"
)
View Source
const (
	HeaderAuthorization          = "Authorization"
	HeaderAuxiliaryAuthorization = "x-ms-authorization-auxiliary"
	HeaderAzureAsync             = "Azure-AsyncOperation"
	HeaderContentLength          = "Content-Length"
	HeaderContentType            = "Content-Type"
	HeaderFakePollerStatus       = "Fake-Poller-Status"
	HeaderLocation               = "Location"
	HeaderOperationLocation      = "Operation-Location"
	HeaderRetryAfter             = "Retry-After"
	HeaderUserAgent              = "User-Agent"
	HeaderWWWAuthenticate        = "WWW-Authenticate"
	HeaderXMSClientRequestID     = "x-ms-client-request-id"
	HeaderXMSRequestID           = "x-ms-request-id"
	HeaderXMSErrorCode           = "x-ms-error-code"
)
View Source
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.8.0-beta.3"
)
View Source
const BearerTokenPrefix = "Bearer "

Variables

This section is empty.

Functions

func Delay

func Delay(ctx context.Context, delay time.Duration) error

Delay waits for the duration to elapse or the context to be cancelled.

func ExtractModuleName added in v1.6.1

func ExtractModuleName(clientName string) (string, string, error)

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 NonRetriableError added in v1.8.0

func NonRetriableError(err error) error

NonRetriableError marks the specified error as non-retriable.

func RetryAfter

func RetryAfter(resp *http.Response) time.Duration

RetryAfter returns non-zero if the response contains a Retry-After header value.

func TypeOfT added in v0.23.0

func TypeOfT[T any]() reflect.Type

TypeOfT returns the type of the generic type param.

func ValidateModVer added in v1.3.0

func ValidateModVer(moduleVersion string) error

ValidateModVer verifies that moduleVersion is a valid semver 2.0 string.

Types

type CtxAPINameKey added in v1.9.0

type CtxAPINameKey struct{}

CtxAPINameKey is used as a context key for adding/retrieving the API name.

type CtxWithCaptureResponse added in v1.8.0

type CtxWithCaptureResponse struct{}

CtxWithCaptureResponse 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 CtxWithTracingTracer added in v1.9.0

type CtxWithTracingTracer struct{}

CtxWithTracingTracer is used as a context key for adding/retrieving tracing.Tracer.

type TransportFunc added in v1.0.0

type TransportFunc func(*http.Request) (*http.Response, error)

TransportFunc is a helper to use a first-class func to satisfy the Transporter interface.

func (TransportFunc) Do added in v1.0.0

func (pf TransportFunc) Do(req *http.Request) (*http.Response, error)

Do implements the Transporter interface for the TransportFunc type.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL