Help us shape the future of Go! Take the 2026 Go Developer Survey

local

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLocalProvider

func NewLocalProvider(config *Config) (Provider, error)

NewLocalProvider creates a new local file system storage provider Example configuration:

Provider: "local"
BasePath: "/var/data/storage"  // Base directory for storage

Types

type LocalProvider

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

LocalProvider implements the Provider interface for local file system storage

func (*LocalProvider) BucketExists

func (p *LocalProvider) BucketExists(ctx context.Context, bucketName string) (bool, error)

BucketExists checks if a bucket (directory) exists

func (*LocalProvider) CopyObject

func (p *LocalProvider) CopyObject(ctx context.Context, srcBucket, srcObject, dstBucket, dstObject string) (ObjectInfo, error)

CopyObject copies an object from source to destination

func (*LocalProvider) CreateBucket

func (p *LocalProvider) CreateBucket(ctx context.Context, bucketName string) error

CreateBucket creates a new bucket (directory)

func (*LocalProvider) GetObject

func (p *LocalProvider) GetObject(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error)

GetObject downloads an object from a bucket

func (*LocalProvider) ListBuckets

func (p *LocalProvider) ListBuckets(ctx context.Context) ([]BucketInfo, error)

ListBuckets lists all buckets (directories)

func (*LocalProvider) ListObjects

func (p *LocalProvider) ListObjects(ctx context.Context, bucketName, prefix string, recursive bool) <-chan ObjectInfo

ListObjects lists objects in a bucket

func (*LocalProvider) PresignedGetObject

func (p *LocalProvider) PresignedGetObject(ctx context.Context, bucketName, objectName string, expires time.Duration) (string, error)

PresignedGetObject generates a presigned URL for GET operation For local storage, presigned URLs are not applicable Returns the local file path

func (*LocalProvider) PresignedPutObject

func (p *LocalProvider) PresignedPutObject(ctx context.Context, bucketName, objectName string, expires time.Duration) (string, error)

PresignedPutObject generates a presigned URL for PUT operation For local storage, presigned URLs are not applicable Returns the local file path

func (*LocalProvider) PutObject

func (p *LocalProvider) PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, opts PutObjectOptions) (ObjectInfo, error)

PutObject uploads an object to a bucket

func (*LocalProvider) RemoveBucket

func (p *LocalProvider) RemoveBucket(ctx context.Context, bucketName string) error

RemoveBucket removes a bucket (directory)

func (*LocalProvider) RemoveObject

func (p *LocalProvider) RemoveObject(ctx context.Context, bucketName, objectName string) error

RemoveObject removes an object from a bucket

func (*LocalProvider) RemoveObjects

func (p *LocalProvider) RemoveObjects(ctx context.Context, bucketName string, objectNames []string) <-chan RemoveObjectError

RemoveObjects removes multiple objects from a bucket

func (*LocalProvider) StatObject

func (p *LocalProvider) StatObject(ctx context.Context, bucketName, objectName string) (ObjectInfo, error)

StatObject gets object metadata

Jump to

Keyboard shortcuts

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