Documentation
¶
Overview ¶
Package blobstorage provides a BinaryStore implementation backed by Azure Blob Storage. Each named file maps 1:1 to a block blob inside the configured container.
Index ¶
- func NewAzureBlobStorage(log logger.Logger) binarystore.BinaryStore
- type AzureBlobStorage
- func (a *AzureBlobStorage) Close() error
- func (a *AzureBlobStorage) Delete(ctx context.Context, req *binarystore.DeleteRequest) error
- func (a *AzureBlobStorage) Features() []binarystore.Feature
- func (a *AzureBlobStorage) Get(ctx context.Context, req *binarystore.GetRequest) (*binarystore.GetResponse, error)
- func (a *AzureBlobStorage) GetComponentMetadata() (metadataInfo contribMetadata.MetadataMap)
- func (a *AzureBlobStorage) Init(ctx context.Context, md binarystore.Metadata) error
- func (a *AzureBlobStorage) Set(ctx context.Context, req *binarystore.SetRequest) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAzureBlobStorage ¶
func NewAzureBlobStorage(log logger.Logger) binarystore.BinaryStore
NewAzureBlobStorage returns a new AzureBlobStorage binary store.
Types ¶
type AzureBlobStorage ¶
type AzureBlobStorage struct {
// contains filtered or unexported fields
}
AzureBlobStorage implements binarystore.BinaryStore using Azure Blob Storage.
func (*AzureBlobStorage) Close ¶
func (a *AzureBlobStorage) Close() error
Close closes the underlying Azure Blob Storage client.
func (*AzureBlobStorage) Delete ¶
func (a *AzureBlobStorage) Delete(ctx context.Context, req *binarystore.DeleteRequest) error
Delete removes a blob from Azure Blob Storage. If the blob does not exist, binarystore.ErrFileNotFound is returned.
func (*AzureBlobStorage) Features ¶
func (a *AzureBlobStorage) Features() []binarystore.Feature
Features returns the optional features supported by this component.
func (*AzureBlobStorage) Get ¶
func (a *AzureBlobStorage) Get(ctx context.Context, req *binarystore.GetRequest) (*binarystore.GetResponse, error)
Get downloads binary data from Azure Blob Storage as a streaming reader.
The Data field of the returned GetResponse wraps the HTTP response body and must be closed by the caller when reading is complete.
func (*AzureBlobStorage) GetComponentMetadata ¶
func (a *AzureBlobStorage) GetComponentMetadata() (metadataInfo contribMetadata.MetadataMap)
GetComponentMetadata returns the metadata schema for this component, used by the Dapr metadata linter.
func (*AzureBlobStorage) Init ¶
func (a *AzureBlobStorage) Init(ctx context.Context, md binarystore.Metadata) error
Init initialises the Azure Blob Storage client from the component metadata.
func (*AzureBlobStorage) Set ¶
func (a *AzureBlobStorage) Set(ctx context.Context, req *binarystore.SetRequest) error
Set uploads binary data to Azure Blob Storage.
When req.Overwrite is false an If-None-Match: * access condition is applied so that the server rejects the upload atomically if the blob already exists, returning binarystore.ErrFileAlreadyExists. When req.Overwrite is true the blob is created or replaced without a condition check.