azure

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package azure implements bsw.BlockStorageWrapper for Azure Blob Storage.

All objects are stored in one container. The bucket is the beginning of the blob name: <container>/<bucket>/<key>, it may have several elements.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrCredential = errors.Template("failed to create credential").
					Code("BSW-0301").StatusCode(500).Severity(errors.Critical)
	ErrServiceClient = errors.Template("failed to create service client").
						Code("BSW-0302").StatusCode(503).Severity(errors.Critical)
	ErrPresignPutURL = errors.Template("failed to create SAS put URL").
						Code("BSW-0303").StatusCode(503).Severity(errors.Critical)
	ErrPresignGetURL = errors.Template("failed to create SAS get URL").
						Code("BSW-0304").StatusCode(503).Severity(errors.Critical)
)

Functions

This section is empty.

Types

type AzureCompletedPart deprecated

type AzureCompletedPart = bsw.Part

AzureCompletedPart describes an uploaded part.

Deprecated: use bsw.Part.

type Config

type Config struct {
	AccountName   string `json:"accountName"`
	AccountKey    string `json:"accountKey"`
	ContainerName string `json:"containerName"`

	// ServiceURL overrides the blob service URL, e.g. for Azurite. Optional.
	// Default: https://<AccountName>.blob.core.windows.net/
	ServiceURL string `json:"serviceURL"`
}

Config holds Azure Blob Storage settings.

type Service

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

Service implements bsw.BlockStorageWrapper for Azure Blob Storage.

func New

func New(cfg *Config) *Service

New returns a service. cfg is copied. Init must be called before use.

func (*Service) CompleteMultipartUpload

func (s *Service) CompleteMultipartUpload(o *bsw.Object, uploadID string, parts []bsw.CompletedPart) error

CompleteMultipartUpload is not supported yet.

func (*Service) Init

func (s *Service) Init(ctx context.Context) error

Init creates the container client. It does not connect to Azure.

func (*Service) Name

func (s *Service) Name() string

Name returns "azure".

func (*Service) PreSignGetObjectURL

func (s *Service) PreSignGetObjectURL(o *bsw.Object, timeout time.Duration) (string, error)

PreSignGetObjectURL returns a SAS URL for GET blob request.

func (*Service) PreSignMultipartObjectURL

func (s *Service) PreSignMultipartObjectURL(o *bsw.Object, timeout time.Duration) ([]string, string, error)

PreSignMultipartObjectURL is not supported yet.

func (*Service) PreSignPutObjectURL

func (s *Service) PreSignPutObjectURL(o *bsw.Object, timeout time.Duration) (string, error)

PreSignPutObjectURL returns a SAS URL for PUT blob request.

Jump to

Keyboard shortcuts

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