blobstorage

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package blobstorage provides an in-memory mock implementation of Azure Blob Storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mock

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

Mock is an in-memory mock implementation of Azure Blob Storage.

func New

func New(opts *config.Options) *Mock

New creates a new Azure Blob Storage mock.

func (*Mock) AbortMultipartUpload added in v1.2.0

func (m *Mock) AbortMultipartUpload(_ context.Context, bucket, _, uploadID string) error

func (*Mock) CompleteMultipartUpload added in v1.2.0

func (m *Mock) CompleteMultipartUpload(
	_ context.Context, bucket, key, uploadID string, parts []driver.UploadPart,
) error

func (*Mock) CopyObject

func (m *Mock) CopyObject(_ context.Context, dstBucket, dstKey string, src driver.CopySource) error

CopyObject copies a blob from one location to another.

func (*Mock) CreateBucket

func (m *Mock) CreateBucket(_ context.Context, name string) error

CreateBucket creates a new blob container.

func (*Mock) CreateMultipartUpload added in v1.2.0

func (m *Mock) CreateMultipartUpload(
	_ context.Context, bucket, key, contentType string,
) (*driver.MultipartUpload, error)

func (*Mock) DeleteBucket

func (m *Mock) DeleteBucket(_ context.Context, name string) error

DeleteBucket deletes a blob container.

func (*Mock) DeleteBucketPolicy added in v1.3.1

func (m *Mock) DeleteBucketPolicy(_ context.Context, bucket string) error

func (*Mock) DeleteBucketTagging added in v1.4.0

func (m *Mock) DeleteBucketTagging(_ context.Context, bucket string) error

DeleteBucketTagging removes all tags from a container.

func (*Mock) DeleteCORSConfig added in v1.3.1

func (m *Mock) DeleteCORSConfig(_ context.Context, bucket string) error

func (*Mock) DeleteObject

func (m *Mock) DeleteObject(_ context.Context, bucket, key string) error

DeleteObject deletes a blob from a container.

func (*Mock) DeleteObjectTagging added in v1.4.0

func (m *Mock) DeleteObjectTagging(_ context.Context, bucket, key string) error

DeleteObjectTagging removes all tags from a blob.

func (*Mock) EvaluateLifecycle added in v1.2.0

func (m *Mock) EvaluateLifecycle(_ context.Context, bucket string) ([]string, error)

func (*Mock) GeneratePresignedURL added in v1.2.0

func (m *Mock) GeneratePresignedURL(_ context.Context, req driver.PresignedURLRequest) (*driver.PresignedURL, error)

GeneratePresignedURL generates a mock presigned URL. Note: expiry is tracked in the URL but not enforced on use — this is a mock limitation.

func (*Mock) GetBucketPolicy added in v1.3.1

func (m *Mock) GetBucketPolicy(_ context.Context, bucket string) (*driver.BucketPolicy, error)

func (*Mock) GetBucketTagging added in v1.4.0

func (m *Mock) GetBucketTagging(_ context.Context, bucket string) (map[string]string, error)

GetBucketTagging returns tags for a container.

func (*Mock) GetBucketVersioning added in v1.2.0

func (m *Mock) GetBucketVersioning(_ context.Context, bucket string) (bool, error)

func (*Mock) GetCORSConfig added in v1.3.1

func (m *Mock) GetCORSConfig(_ context.Context, bucket string) (*driver.CORSConfig, error)

func (*Mock) GetEncryptionConfig added in v1.3.1

func (m *Mock) GetEncryptionConfig(_ context.Context, bucket string) (*driver.EncryptionConfig, error)

func (*Mock) GetLifecycleConfig added in v1.2.0

func (m *Mock) GetLifecycleConfig(_ context.Context, bucket string) (*driver.LifecycleConfig, error)

func (*Mock) GetObject

func (m *Mock) GetObject(_ context.Context, bucket, key string) (*driver.Object, error)

GetObject retrieves a blob from a container.

func (*Mock) GetObjectTagging added in v1.4.0

func (m *Mock) GetObjectTagging(_ context.Context, bucket, key string) (map[string]string, error)

GetObjectTagging returns tags for a blob.

func (*Mock) HeadObject

func (m *Mock) HeadObject(_ context.Context, bucket, key string) (*driver.ObjectInfo, error)

HeadObject returns metadata for a blob without its data.

func (*Mock) ListBuckets

func (m *Mock) ListBuckets(_ context.Context) ([]driver.BucketInfo, error)

ListBuckets lists all blob containers.

func (*Mock) ListMultipartUploads added in v1.2.0

func (m *Mock) ListMultipartUploads(_ context.Context, bucket string) ([]driver.MultipartUpload, error)

func (*Mock) ListObjects

func (m *Mock) ListObjects(_ context.Context, bucket string, opts driver.ListOptions) (*driver.ListResult, error)

ListObjects lists blobs in a container with optional prefix/delimiter filtering.

func (*Mock) PutBucketPolicy added in v1.3.1

func (m *Mock) PutBucketPolicy(_ context.Context, bucket string, policy driver.BucketPolicy) error

func (*Mock) PutBucketTagging added in v1.4.0

func (m *Mock) PutBucketTagging(_ context.Context, bucket string, tags map[string]string) error

PutBucketTagging sets tags on a container.

func (*Mock) PutCORSConfig added in v1.3.1

func (m *Mock) PutCORSConfig(_ context.Context, bucket string, cfg driver.CORSConfig) error

func (*Mock) PutEncryptionConfig added in v1.3.1

func (m *Mock) PutEncryptionConfig(_ context.Context, bucket string, cfg driver.EncryptionConfig) error

func (*Mock) PutLifecycleConfig added in v1.2.0

func (m *Mock) PutLifecycleConfig(_ context.Context, bucket string, cfg driver.LifecycleConfig) error

func (*Mock) PutObject

func (m *Mock) PutObject(_ context.Context, bucket, key string, data []byte, contentType string, metadata map[string]string) error

PutObject stores a blob in a container.

func (*Mock) PutObjectTagging added in v1.4.0

func (m *Mock) PutObjectTagging(_ context.Context, bucket, key string, tags map[string]string) error

PutObjectTagging sets tags on a blob.

func (*Mock) SetBucketVersioning added in v1.2.0

func (m *Mock) SetBucketVersioning(_ context.Context, bucket string, enabled bool) error

SetBucketVersioning enables or disables versioning on a bucket. Note: this sets the flag but does not maintain object version history — mock limitation.

func (*Mock) SetMonitoring added in v1.2.0

func (m *Mock) SetMonitoring(mon mondriver.Monitoring)

SetMonitoring sets the monitoring backend for auto-metric generation.

func (*Mock) UploadPart added in v1.2.0

func (m *Mock) UploadPart(
	_ context.Context, bucket, _, uploadID string, partNumber int, data []byte,
) (*driver.UploadPart, error)

Jump to

Keyboard shortcuts

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