package shared
import "github.com/Azure/azure-sdk-for-go/sdk/azcore/internal/shared"
Index ¶
- Constants
- func Delay(ctx context.Context, delay time.Duration) error
- func ExtractPackageName(clientName string) (string, error)
- func RetryAfter(resp *http.Response) time.Duration
- func TypeOfT[T any]() reflect.Type
- func ValidateModVer(moduleVersion string) error
- type BytesSetter
- type CtxIncludeResponseKey
- type CtxWithHTTPHeaderKey
- type CtxWithRetryOptionsKey
- type NopClosingBytesReader
- func NewNopClosingBytesReader(data []byte) *NopClosingBytesReader
- func (r *NopClosingBytesReader) Bytes() []byte
- func (*NopClosingBytesReader) Close() error
- func (r *NopClosingBytesReader) Read(b []byte) (n int, err error)
- func (r *NopClosingBytesReader) Seek(offset int64, whence int) (int64, error)
- func (r *NopClosingBytesReader) Set(b []byte)
- 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" )
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.3.0" )
const BearerTokenPrefix = "Bearer "
Functions ¶
func Delay ¶
Delay waits for the duration to elapse or the context to be cancelled.
func ExtractPackageName ¶
ExtractPackageName returns "package" from "package.Client". If clientName is malformed, an error is returned.
func RetryAfter ¶
RetryAfter returns non-zero if the response contains a Retry-After header value.
func TypeOfT ¶
TypeOfT returns the type of the generic type param.
func ValidateModVer ¶
ValidateModVer verifies that moduleVersion is a valid semver 2.0 string.
Types ¶
type BytesSetter ¶
type BytesSetter interface { Set(b []byte) }
BytesSetter abstracts replacing a byte slice on some type.
type CtxIncludeResponseKey ¶
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 NopClosingBytesReader ¶
type NopClosingBytesReader struct {
// contains filtered or unexported fields
}
NopClosingBytesReader is an io.ReadSeekCloser around a byte slice. It also provides direct access to the byte slice to avoid rereading.
func NewNopClosingBytesReader ¶
func NewNopClosingBytesReader(data []byte) *NopClosingBytesReader
NewNopClosingBytesReader creates a new *NopClosingBytesReader for the specified slice.
func (*NopClosingBytesReader) Bytes ¶
func (r *NopClosingBytesReader) Bytes() []byte
Bytes returns the underlying byte slice.
func (*NopClosingBytesReader) Close ¶
func (*NopClosingBytesReader) Close() error
Close implements the io.Closer interface.
func (*NopClosingBytesReader) Read ¶
func (r *NopClosingBytesReader) Read(b []byte) (n int, err error)
Read implements the io.Reader interface.
func (*NopClosingBytesReader) Seek ¶
func (r *NopClosingBytesReader) Seek(offset int64, whence int) (int64, error)
Seek implements the io.Seeker interface.
func (*NopClosingBytesReader) Set ¶
func (r *NopClosingBytesReader) Set(b []byte)
Set replaces the existing byte slice with the specified byte slice and resets the reader.
type TransportFunc ¶
TransportFunc is a helper to use a first-class func to satisfy the Transporter interface.
func (TransportFunc) Do ¶
Do implements the Transporter interface for the TransportFunc type.
Source Files ¶
- Version
- v1.3.0
- Published
- Jan 6, 2023
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 33 minutes ago –
Tools for package owners.