azure_blob

package
v3.46.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaxRetries defines the maximum number of retry attempts for Azure operations
	MaxRetries = 3
	// RetryDelay defines the base delay between retries
	RetryDelay = 3 * time.Second
	// MaxBatchSize defines the maximum number of operations in a single batch request
	MaxBatchSize = 128
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Addition

type Addition struct {
	Endpoint      string `` /* 270-byte string literal not displayed */
	AccessKey     string `` /* 176-byte string literal not displayed */
	ContainerName string `` /* 189-byte string literal not displayed */
	SignURLExpire int    `json:"sign_url_expire" type:"number" default:"4" help:"The expiration time for SAS URLs, in hours."`
}

func (Addition) GetRootId

func (r Addition) GetRootId() string

implement GetRootId interface

type AzureBlob

type AzureBlob struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

Azure Blob Storage based on the blob APIs Link: https://learn.microsoft.com/rest/api/storageservices/blob-service-rest-api

func (*AzureBlob) Config

func (d *AzureBlob) Config() driver.Config

Config returns the driver configuration.

func (*AzureBlob) Copy

func (d *AzureBlob) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

Copy duplicates an object (file or directory) to a specified destination directory.

func (*AzureBlob) Drop

func (d *AzureBlob) Drop(ctx context.Context) error

Drop releases resources associated with the Azure Blob client.

func (*AzureBlob) GetAddition

func (d *AzureBlob) GetAddition() driver.Additional

GetAddition returns additional settings specific to Azure Blob Storage.

func (*AzureBlob) Init

func (d *AzureBlob) Init(ctx context.Context) error

Init initializes the Azure Blob Storage client using shared key authentication.

func (d *AzureBlob) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)

Link generates a temporary SAS URL for accessing a blob.

func (*AzureBlob) List

func (d *AzureBlob) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

List retrieves blobs and directories under the specified path.

func (*AzureBlob) MakeDir

func (d *AzureBlob) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

MakeDir creates a virtual directory by uploading an empty blob as a marker.

func (*AzureBlob) Move

func (d *AzureBlob) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

Move relocates an object (file or directory) to a new directory.

func (*AzureBlob) Put

func (d *AzureBlob) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) (model.Obj, error)

Put uploads a file stream to Azure Blob Storage with progress tracking.

func (*AzureBlob) Remove

func (d *AzureBlob) Remove(ctx context.Context, obj model.Obj) error

Remove deletes a specified blob or recursively deletes a directory and its contents.

func (*AzureBlob) Rename

func (d *AzureBlob) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

Rename changes the name of an existing object.

Jump to

Keyboard shortcuts

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