driver

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package driver defines the interface for storage service implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bucket

type Bucket interface {
	CreateBucket(ctx context.Context, name string) error
	DeleteBucket(ctx context.Context, name string) error
	ListBuckets(ctx context.Context) ([]BucketInfo, error)

	PutObject(ctx context.Context, bucket, key string, data []byte, contentType string, metadata map[string]string) error
	GetObject(ctx context.Context, bucket, key string) (*Object, error)
	DeleteObject(ctx context.Context, bucket, key string) error
	HeadObject(ctx context.Context, bucket, key string) (*ObjectInfo, error)
	ListObjects(ctx context.Context, bucket string, opts ListOptions) (*ListResult, error)
	CopyObject(ctx context.Context, dstBucket, dstKey string, src CopySource) error
}

Bucket is the interface that storage provider implementations must satisfy.

type BucketInfo

type BucketInfo struct {
	Name      string
	Region    string
	CreatedAt string
}

BucketInfo describes a storage bucket.

type CopySource

type CopySource struct {
	Bucket string
	Key    string
}

CopySource identifies the source for a copy operation.

type ListOptions

type ListOptions struct {
	Prefix    string
	Delimiter string
	MaxKeys   int
	PageToken string
}

ListOptions configures a list operation.

type ListResult

type ListResult struct {
	Objects        []ObjectInfo
	CommonPrefixes []string
	NextPageToken  string
	IsTruncated    bool
}

ListResult is the result of a list operation.

type Object

type Object struct {
	Info ObjectInfo
	Data []byte
}

Object is an object with its data.

type ObjectInfo

type ObjectInfo struct {
	Key          string
	Size         int64
	ContentType  string
	ETag         string
	LastModified string
	Metadata     map[string]string
}

ObjectInfo describes a stored object.

Jump to

Keyboard shortcuts

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