blob

package
v0.1.19 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UploadAll

func UploadAll(ctx context.Context, uploader ObjectUploader, opts ...BatchUploaderOption) error

UploadAll uploads multiple items concurrently to the blob storage using the provided ObjectUploader.

func UploadAllFromFS

func UploadAllFromFS(ctx context.Context, uploader ObjectUploader, fsys fs.FS, opts ...BatchUploaderFSOption) error

UploadAllFromFS uploads all files from the provided filesystem to the blob storage using the given uploader.

Types

type BatchUploaderFSOption

type BatchUploaderFSOption func(*batchUploaderFSOpts)

BatchUploaderFSOption defines a function type for configuring the batch uploader options.

func WithBatchUploadFSMaxProcs

func WithBatchUploadFSMaxProcs(maxProcs int) BatchUploaderFSOption

WithBatchUploadFSMaxProcs sets the maximum number of concurrent uploads for filesystem uploads.

type BatchUploaderOption

type BatchUploaderOption func(*batchUploaderOpts)

func WithBatchUploadItem

func WithBatchUploadItem(key string, data io.Reader) BatchUploaderOption

WithBatchUploadItem sets the items to be uploaded.

func WithBatchUploadItemBytes

func WithBatchUploadItemBytes(key string, data []byte) BatchUploaderOption

WithBatchUploadItemBytes sets a byte slice as an item to be uploaded.

func WithBatchUploaderMaxProcs

func WithBatchUploaderMaxProcs(maxProcs int) BatchUploaderOption

WithBatchUploaderMaxProcs sets the maximum number of concurrent uploads.

type Bucket

type Bucket interface {
	ObjectUploader
	ObjectRemover
}

Bucket is a component providing functionality for uploading and removing objects.

type ObjectRemover

type ObjectRemover interface {
	// Remove deletes a file from the storage bucket using the provided object key.
	Remove(ctx context.Context, key string) error
}

ObjectRemover is an interface for removing objects from a storage bucket.

type ObjectUploader

type ObjectUploader interface {
	// Upload uploads a file to the storage bucket using the provided object key and its data.
	Upload(ctx context.Context, key string, data io.Reader) error
}

ObjectUploader is an interface for uploading objects to a storage bucket.

Jump to

Keyboard shortcuts

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