blob

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package blob implements the Azure Blob Storage REST+XML wire protocol as a server.Handler. Real azure-sdk-for-go azblob clients configured with a custom service URL hit this handler the same way they hit {account}.blob.core.windows.net.

Supported operations (parity with AWS S3):

GET    /?comp=list                                  — list containers
PUT    /{container}?restype=container               — create container
DELETE /{container}?restype=container               — delete container
GET    /{container}?restype=container&comp=list     — list blobs
PUT    /{container}/{blob}                          — put blob (BlockBlob)
PUT    /{container}/{blob} (x-ms-copy-source)       — copy blob
GET    /{container}/{blob}                          — get blob
HEAD   /{container}/{blob}                          — head blob
DELETE /{container}/{blob}                          — delete blob

Less-used surfaces (lifecycle, encryption, tags, access policies, leases, snapshots, versioning) are not yet wired and return 501.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler serves Azure Blob Storage REST requests against a storage.Bucket driver.

func New

New returns a Blob handler backed by b.

func (*Handler) Matches

func (*Handler) Matches(r *http.Request) bool

Matches returns true for requests that look like Azure Blob calls. The shape: path doesn't start with /subscriptions/ (that's ARM management plane), and the request isn't a known REST style we delegate elsewhere.

In practice this handler is registered as the data-plane fallback for the Azure server, so Matches() is permissive.

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP routes the request based on path shape and query params.

Jump to

Keyboard shortcuts

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