Documentation ¶
Overview ¶
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License. See License.txt in the project root for license information.
Index ¶
- Constants
- Variables
- func CopyOptions[T any](opts *T) *T
- func DoBatchTransfer(ctx context.Context, o *BatchTransferOptions) error
- func EscapeSplitPaths(filePath string) string
- func GenerateLeaseID(leaseID *string) (*string, error)
- func GetClientOptions[T any](o *T) *T
- func GetURLs(url string) (string, string)
- func IsIPEndpointStyle(host string) bool
- func NewBytesWriter(b []byte) bytesWriter
- func NewIncludeBlobResponsePolicy() policy.Policy
- func NewStorageChallengePolicy(cred azcore.TokenCredential, audience string, allowHTTP bool) policy.Policy
- func NopCloser(rs io.ReadSeeker) io.ReadSeekCloser
- func RangeToString(offset, count int64) string
- func SerializeBlobTagsToStrPtr(tagsMap map[string]string) *string
- func ValidateSeekableStreamAt0AndGetCount(body io.ReadSeeker) (int64, error)
- func WithCaptureBlobResponse(parent context.Context, resp **http.Response) context.Context
- type BatchTransferOptions
- type CtxIncludeBlobResponseKey
- type ParsedConnectionString
- type SectionWriter
Constants ¶
const ( HeaderAuthorization = "Authorization" HeaderXmsDate = "x-ms-date" HeaderContentLength = "Content-Length" HeaderContentEncoding = "Content-Encoding" HeaderContentLanguage = "Content-Language" HeaderContentType = "Content-Type" HeaderContentMD5 = "Content-MD5" HeaderIfModifiedSince = "If-Modified-Since" HeaderIfMatch = "If-Match" HeaderIfNoneMatch = "If-None-Match" HeaderIfUnmodifiedSince = "If-Unmodified-Since" HeaderRange = "Range" HeaderXmsVersion = "x-ms-version" HeaderXmsRequestID = "x-ms-request-id" )
const (
TokenScope = "https://storage.azure.com/.default"
)
Variables ¶
var CRC64Table = crc64.MakeTable(crc64Polynomial)
Functions ¶
func CopyOptions ¶
func CopyOptions[T any](opts *T) *T
CopyOptions returns a zero-value T if opts is nil. If opts is not nil, a copy is made and its address returned.
func DoBatchTransfer ¶
func DoBatchTransfer(ctx context.Context, o *BatchTransferOptions) error
DoBatchTransfer helps to execute operations in a batch manner. Can be used by users to customize batch works (for other scenarios that the SDK does not provide)
func EscapeSplitPaths ¶ added in v1.1.0
EscapeSplitPaths is utility function to escape the individual strings by eliminating "/" in the path
func GenerateLeaseID ¶
func GetClientOptions ¶
func GetClientOptions[T any](o *T) *T
func IsIPEndpointStyle ¶
IsIPEndpointStyle checkes if URL's host is IP, in this case the storage account endpoint will be composed as: http(s)://IP(:port)/storageaccount/container/... As url's Host property, host could be both host or host:port
func NewBytesWriter ¶
func NewBytesWriter(b []byte) bytesWriter
func NewIncludeBlobResponsePolicy ¶
NewIncludeBlobResponsePolicy creates a policy that retrieves the raw HTTP response upon request
func NewStorageChallengePolicy ¶ added in v1.1.2
func NopCloser ¶
func NopCloser(rs io.ReadSeeker) io.ReadSeekCloser
NopCloser returns a ReadSeekCloser with a no-op close method wrapping the provided io.ReadSeeker.
func RangeToString ¶
func ValidateSeekableStreamAt0AndGetCount ¶
func ValidateSeekableStreamAt0AndGetCount(body io.ReadSeeker) (int64, error)
Types ¶
type BatchTransferOptions ¶
type BatchTransferOptions struct { TransferSize int64 ChunkSize int64 Concurrency uint16 Operation func(ctx context.Context, offset int64, chunkSize int64) error OperationName string }
BatchTransferOptions identifies options used by doBatchTransfer.
type CtxIncludeBlobResponseKey ¶
type CtxIncludeBlobResponseKey struct{}
CtxIncludeBlobResponseKey is used as a context key for retrieving the raw response.
type ParsedConnectionString ¶
func ParseConnectionString ¶
func ParseConnectionString(connectionString string) (ParsedConnectionString, error)
type SectionWriter ¶
func NewSectionWriter ¶
func NewSectionWriter(c io.WriterAt, off int64, count int64) *SectionWriter