filesystem

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(config interface{}) (backend.Backend, error)

New creates a new filesystem backend

Types

type Backend

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

Backend implements the filesystem storage backend

func (*Backend) AbortMultipartUpload

func (b *Backend) AbortMultipartUpload(ctx context.Context, bucketName, key, uploadID string) error

AbortMultipartUpload cancels a multipart upload and cleans up parts

func (*Backend) Close

func (b *Backend) Close() error

Close cleans up any resources

func (*Backend) CompleteMultipartUpload

CompleteMultipartUpload assembles parts into the final object

func (*Backend) CreateBucket

CreateBucket creates a new bucket in the filesystem backend For filesystem backend, this is not supported - buckets must be defined in config

func (*Backend) CreateMultipartUpload

CreateMultipartUpload initiates a multipart upload

func (*Backend) DeleteBucket

func (b *Backend) DeleteBucket(ctx context.Context, req *backend.DeleteBucketRequest) error

DeleteBucket deletes a bucket from the filesystem backend For filesystem backend, this is not supported - buckets must be managed via config

func (*Backend) DeleteObject

func (b *Backend) DeleteObject(ctx context.Context, req *backend.DeleteObjectRequest) error

DeleteObject removes an object from the filesystem

func (*Backend) GetObject

GetObject retrieves an object with optional range support

func (*Backend) HeadBucket

HeadBucket checks if a bucket exists in the filesystem backend

func (*Backend) HeadObject

func (b *Backend) HeadObject(ctx context.Context, bucketName, key string) (*backend.HeadObjectResponse, error)

HeadObject returns object metadata without the body

func (*Backend) ListBuckets

func (b *Backend) ListBuckets(ctx context.Context, ownerID string) (*backend.ListBucketsResponse, error)

ListBuckets returns a list of all configured buckets ownerID is accepted for interface compatibility but ignored for filesystem backend

func (*Backend) ListObjects

ListObjects returns objects in a bucket with optional prefix filtering

func (*Backend) PutObject

PutObject stores an object in the filesystem

func (*Backend) Type

func (b *Backend) Type() string

Type returns the backend type identifier

func (*Backend) UploadPart

UploadPart handles uploading a single part of a multipart upload

type BucketConfig

type BucketConfig struct {
	Name     string
	Pathname string
	Region   string
	Type     string
	Public   bool
}

BucketConfig defines a bucket configuration

type Config

type Config struct {
	Buckets   []BucketConfig
	TempDir   string // Directory for multipart uploads (defaults to os.TempDir())
	OwnerID   string
	OwnerName string
}

Config holds filesystem backend configuration

Jump to

Keyboard shortcuts

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