Documentation
¶
Index ¶
- func NewLocalProvider(config *Config) (Provider, error)
- type LocalProvider
- func (p *LocalProvider) BucketExists(ctx context.Context, bucketName string) (bool, error)
- func (p *LocalProvider) CopyObject(ctx context.Context, srcBucket, srcObject, dstBucket, dstObject string) (ObjectInfo, error)
- func (p *LocalProvider) CreateBucket(ctx context.Context, bucketName string) error
- func (p *LocalProvider) GetObject(ctx context.Context, bucketName, objectName string, opts GetObjectOptions) (io.ReadCloser, ObjectInfo, error)
- func (p *LocalProvider) ListBuckets(ctx context.Context) ([]BucketInfo, error)
- func (p *LocalProvider) ListObjects(ctx context.Context, bucketName, prefix string, recursive bool) <-chan ObjectInfo
- func (p *LocalProvider) PresignedGetObject(ctx context.Context, bucketName, objectName string, expires time.Duration) (string, error)
- func (p *LocalProvider) PresignedPutObject(ctx context.Context, bucketName, objectName string, expires time.Duration) (string, error)
- func (p *LocalProvider) PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, ...) (ObjectInfo, error)
- func (p *LocalProvider) RemoveBucket(ctx context.Context, bucketName string) error
- func (p *LocalProvider) RemoveObject(ctx context.Context, bucketName, objectName string) error
- func (p *LocalProvider) RemoveObjects(ctx context.Context, bucketName string, objectNames []string) <-chan RemoveObjectError
- func (p *LocalProvider) StatObject(ctx context.Context, bucketName, objectName string) (ObjectInfo, error)
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 ¶
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