Documentation
¶
Index ¶
- Constants
- Variables
- func DBMetrics() []prometheus.Collector
- func IterBuckets(ctx context.Context, store BucketStore, params *ListBucketsParams) iter.Seq2[*types.BucketInfo, error]
- func IterObjects(ctx context.Context, store ObjectStore, params *ListObjectsParams) iter.Seq2[*types.ObjectRef, error]
- func ObjectRefFromJSON(j *ObjectRefJSON) (*types.ObjectRef, error)
- func RunMigrations(ctx context.Context, migrator Migrator, driver Driver) error
- func UpdateConnectionMetrics(inUse, idle, total int)
- type ACLStore
- type BucketLoggingConfig
- type BucketStore
- type CORSStore
- type ChunkInfo
- type ChunkRegistryStore
- type Config
- type DB
- type Driver
- type EncryptionStore
- type FederationStore
- type IntelligentTieringStore
- type LifecycleScanState
- type LifecycleScanStore
- type LifecycleStore
- type ListBucketsParams
- type ListBucketsResult
- type ListObjectsParams
- type ListObjectsResult
- type LoggingStore
- type MetricsDB
- func (m *MetricsDB) AddChunkReplica(ctx context.Context, chunkID, serverID, backendID string) error
- func (m *MetricsDB) Close() error
- func (m *MetricsDB) CompleteRestore(ctx context.Context, objectID string, expiryDate int64) error
- func (m *MetricsDB) CountBuckets(ctx context.Context) (int64, error)
- func (m *MetricsDB) CreateBucket(ctx context.Context, bucket *types.BucketInfo) error
- func (m *MetricsDB) CreateMultipartUpload(ctx context.Context, upload *types.MultipartUpload) error
- func (m *MetricsDB) DecrementChunkRefCount(ctx context.Context, chunkID string) error
- func (m *MetricsDB) DecrementChunkRefCountBatch(ctx context.Context, chunkIDs []string) error
- func (m *MetricsDB) DeleteBucket(ctx context.Context, name string) error
- func (m *MetricsDB) DeleteBucketCORS(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteBucketEncryption(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteBucketLifecycle(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteBucketLogging(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteBucketPolicy(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteBucketTagging(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteBucketWebsite(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteChunkRegistry(ctx context.Context, chunkID string) error
- func (m *MetricsDB) DeleteFederationConfig(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteIntelligentTieringConfiguration(ctx context.Context, bucket string, configID string) error
- func (m *MetricsDB) DeleteMultipartUpload(ctx context.Context, bucket, key, uploadID string) error
- func (m *MetricsDB) DeleteNotificationConfiguration(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteObject(ctx context.Context, bucket, key string) error
- func (m *MetricsDB) DeleteObjectTagging(ctx context.Context, bucket, key string) error
- func (m *MetricsDB) DeleteObjectVersion(ctx context.Context, bucket, key, versionID string) error
- func (m *MetricsDB) DeleteOwnershipControls(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteParts(ctx context.Context, uploadID string) error
- func (m *MetricsDB) DeletePublicAccessBlock(ctx context.Context, bucket string) error
- func (m *MetricsDB) DeleteReplicationConfiguration(ctx context.Context, bucket string) error
- func (m *MetricsDB) GetBucket(ctx context.Context, name string) (*types.BucketInfo, error)
- func (m *MetricsDB) GetBucketACL(ctx context.Context, bucket string) (*s3types.AccessControlList, error)
- func (m *MetricsDB) GetBucketCORS(ctx context.Context, bucket string) (*s3types.CORSConfiguration, error)
- func (m *MetricsDB) GetBucketEncryption(ctx context.Context, bucket string) (*s3types.ServerSideEncryptionConfig, error)
- func (m *MetricsDB) GetBucketLifecycle(ctx context.Context, bucket string) (*s3types.Lifecycle, error)
- func (m *MetricsDB) GetBucketLogging(ctx context.Context, bucket string) (*BucketLoggingConfig, error)
- func (m *MetricsDB) GetBucketPolicy(ctx context.Context, bucket string) (*s3types.BucketPolicy, error)
- func (m *MetricsDB) GetBucketTagging(ctx context.Context, bucket string) (*s3types.TagSet, error)
- func (m *MetricsDB) GetBucketWebsite(ctx context.Context, bucket string) (*s3types.WebsiteConfiguration, error)
- func (m *MetricsDB) GetBucketsNeedingScan(ctx context.Context, minAge time.Duration, limit int) ([]string, error)
- func (m *MetricsDB) GetChunkRefCount(ctx context.Context, chunkID string) (int, error)
- func (m *MetricsDB) GetChunkReplicas(ctx context.Context, chunkID string) ([]ReplicaInfo, error)
- func (m *MetricsDB) GetChunksByServer(ctx context.Context, serverID string) ([]string, error)
- func (m *MetricsDB) GetColdIntelligentTieringObjects(ctx context.Context, threshold int64, minSize int64, limit int) ([]*types.ObjectRef, error)
- func (m *MetricsDB) GetExpiredRestores(ctx context.Context, now int64, limit int) ([]*types.ObjectRef, error)
- func (m *MetricsDB) GetFederatedBucketsNeedingSync(ctx context.Context, limit int) ([]*s3types.FederationConfig, error)
- func (m *MetricsDB) GetFederationConfig(ctx context.Context, bucket string) (*s3types.FederationConfig, error)
- func (m *MetricsDB) GetIntelligentTieringConfiguration(ctx context.Context, bucket string, configID string) (*s3types.IntelligentTieringConfiguration, error)
- func (m *MetricsDB) GetMultipartUpload(ctx context.Context, bucket, key, uploadID string) (*types.MultipartUpload, error)
- func (m *MetricsDB) GetNotificationConfiguration(ctx context.Context, bucket string) (*s3types.NotificationConfiguration, error)
- func (m *MetricsDB) GetObject(ctx context.Context, bucket, key string) (*types.ObjectRef, error)
- func (m *MetricsDB) GetObjectACL(ctx context.Context, bucket, key string) (*s3types.AccessControlList, error)
- func (m *MetricsDB) GetObjectByID(ctx context.Context, id uuid.UUID) (*types.ObjectRef, error)
- func (m *MetricsDB) GetObjectLegalHold(ctx context.Context, bucket, key string) (*s3types.ObjectLockLegalHold, error)
- func (m *MetricsDB) GetObjectLockConfiguration(ctx context.Context, bucket string) (*s3types.ObjectLockConfiguration, error)
- func (m *MetricsDB) GetObjectRetention(ctx context.Context, bucket, key string) (*s3types.ObjectLockRetention, error)
- func (m *MetricsDB) GetObjectTagging(ctx context.Context, bucket, key string) (*s3types.TagSet, error)
- func (m *MetricsDB) GetObjectVersion(ctx context.Context, bucket, key, versionID string) (*types.ObjectRef, error)
- func (m *MetricsDB) GetOwnershipControls(ctx context.Context, bucket string) (*s3types.OwnershipControls, error)
- func (m *MetricsDB) GetPart(ctx context.Context, uploadID string, partNumber int) (*types.MultipartPart, error)
- func (m *MetricsDB) GetPublicAccessBlock(ctx context.Context, bucket string) (*s3types.PublicAccessBlockConfig, error)
- func (m *MetricsDB) GetReplicationConfiguration(ctx context.Context, bucket string) (*s3types.ReplicationConfiguration, error)
- func (m *MetricsDB) GetScanState(ctx context.Context, bucket string) (*LifecycleScanState, error)
- func (m *MetricsDB) GetZeroRefChunks(ctx context.Context, olderThan time.Time, limit int) ([]ZeroRefChunk, error)
- func (m *MetricsDB) IncrementChunkRefCount(ctx context.Context, chunkID string, size int64) error
- func (m *MetricsDB) IncrementChunkRefCountBatch(ctx context.Context, chunks []ChunkInfo) error
- func (m *MetricsDB) ListBuckets(ctx context.Context, params *ListBucketsParams) (*ListBucketsResult, error)
- func (m *MetricsDB) ListBucketsWithLifecycle(ctx context.Context) ([]string, error)
- func (m *MetricsDB) ListDeletedObjects(ctx context.Context, olderThan int64, limit int) ([]*types.ObjectRef, error)
- func (m *MetricsDB) ListFederatedBuckets(ctx context.Context) ([]*s3types.FederationConfig, error)
- func (m *MetricsDB) ListIntelligentTieringConfigurations(ctx context.Context, bucket string) ([]*s3types.IntelligentTieringConfiguration, error)
- func (m *MetricsDB) ListLoggingConfigs(ctx context.Context) ([]*BucketLoggingConfig, error)
- func (m *MetricsDB) ListMultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker string, ...) ([]*types.MultipartUpload, bool, error)
- func (m *MetricsDB) ListObjectVersions(ctx context.Context, ...) ([]*types.ObjectVersion, bool, string, string, error)
- func (m *MetricsDB) ListObjects(ctx context.Context, bucket, prefix string, limit int) ([]*types.ObjectRef, error)
- func (m *MetricsDB) ListObjectsV2(ctx context.Context, params *ListObjectsParams) (*ListObjectsResult, error)
- func (m *MetricsDB) ListParts(ctx context.Context, uploadID string, partNumberMarker, maxParts int) ([]*types.MultipartPart, bool, error)
- func (m *MetricsDB) MarkObjectDeleted(ctx context.Context, bucket, key string, deletedAt int64) error
- func (m *MetricsDB) Migrate(ctx context.Context) error
- func (m *MetricsDB) PutDeleteMarker(ctx context.Context, bucket, key, ownerID string) (string, error)
- func (m *MetricsDB) PutIntelligentTieringConfiguration(ctx context.Context, bucket string, ...) error
- func (m *MetricsDB) PutObject(ctx context.Context, obj *types.ObjectRef) error
- func (m *MetricsDB) PutPart(ctx context.Context, part *types.MultipartPart) error
- func (m *MetricsDB) RemoveChunkReplica(ctx context.Context, chunkID, serverID string) error
- func (m *MetricsDB) ResetRestoreStatus(ctx context.Context, objectID string) error
- func (m *MetricsDB) ResetScanState(ctx context.Context, bucket string) error
- func (m *MetricsDB) SetBucketACL(ctx context.Context, bucket string, acl *s3types.AccessControlList) error
- func (m *MetricsDB) SetBucketCORS(ctx context.Context, bucket string, cors *s3types.CORSConfiguration) error
- func (m *MetricsDB) SetBucketEncryption(ctx context.Context, bucket string, config *s3types.ServerSideEncryptionConfig) error
- func (m *MetricsDB) SetBucketLifecycle(ctx context.Context, bucket string, lifecycle *s3types.Lifecycle) error
- func (m *MetricsDB) SetBucketLogging(ctx context.Context, config *BucketLoggingConfig) error
- func (m *MetricsDB) SetBucketPolicy(ctx context.Context, bucket string, policy *s3types.BucketPolicy) error
- func (m *MetricsDB) SetBucketTagging(ctx context.Context, bucket string, tagSet *s3types.TagSet) error
- func (m *MetricsDB) SetBucketWebsite(ctx context.Context, bucket string, website *s3types.WebsiteConfiguration) error
- func (m *MetricsDB) SetDualWriteEnabled(ctx context.Context, bucket string, enabled bool) error
- func (m *MetricsDB) SetFederationConfig(ctx context.Context, config *s3types.FederationConfig) error
- func (m *MetricsDB) SetMigrationPaused(ctx context.Context, bucket string, paused bool) error
- func (m *MetricsDB) SetNotificationConfiguration(ctx context.Context, bucket string, config *s3types.NotificationConfiguration) error
- func (m *MetricsDB) SetObjectACL(ctx context.Context, bucket, key string, acl *s3types.AccessControlList) error
- func (m *MetricsDB) SetObjectLegalHold(ctx context.Context, bucket, key string, ...) error
- func (m *MetricsDB) SetObjectLockConfiguration(ctx context.Context, bucket string, config *s3types.ObjectLockConfiguration) error
- func (m *MetricsDB) SetObjectRetention(ctx context.Context, bucket, key string, ...) error
- func (m *MetricsDB) SetObjectTagging(ctx context.Context, bucket, key string, tagSet *s3types.TagSet) error
- func (m *MetricsDB) SetOwnershipControls(ctx context.Context, bucket string, controls *s3types.OwnershipControls) error
- func (m *MetricsDB) SetPublicAccessBlock(ctx context.Context, bucket string, config *s3types.PublicAccessBlockConfig) error
- func (m *MetricsDB) SetReplicationConfiguration(ctx context.Context, bucket string, config *s3types.ReplicationConfiguration) error
- func (m *MetricsDB) Unwrap() DB
- func (m *MetricsDB) UpdateBucketVersioning(ctx context.Context, bucket string, versioning string) error
- func (m *MetricsDB) UpdateLastAccessedAt(ctx context.Context, objectID string, accessedAt int64) error
- func (m *MetricsDB) UpdateMigrationProgress(ctx context.Context, bucket string, objectsSynced, bytesSynced int64, ...) error
- func (m *MetricsDB) UpdateObjectTransition(ctx context.Context, objectID string, storageClass string, ...) error
- func (m *MetricsDB) UpdateRestoreExpiry(ctx context.Context, objectID string, expiryDate int64) error
- func (m *MetricsDB) UpdateRestoreStatus(ctx context.Context, objectID string, status string, tier string, ...) error
- func (m *MetricsDB) UpdateScanState(ctx context.Context, state *LifecycleScanState) error
- func (m *MetricsDB) WithTx(ctx context.Context, fn func(tx TxStore) error) error
- type Migration
- type Migrator
- type MultipartStore
- type NotificationStore
- type ObjectLockStore
- type ObjectRefJSON
- type ObjectStore
- type OwnershipControlsStore
- type PolicyStore
- type PublicAccessBlockStore
- type ReplicaInfo
- type ReplicationStore
- type TaggingStore
- type TxStore
- type VersionStore
- type WebsiteStore
- type ZeroRefChunk
Constants ¶
const ( DefaultMaxOpenConns = 100 // Allow more parallel queries DefaultMaxIdleConns = 50 // Keep connections warm to avoid reconnect overhead DefaultConnMaxLifetime = 300 // 5 minutes (seconds) DefaultConnMaxIdleTime = 120 // 2 minutes - keep idle connections longer (seconds) )
Connection pool defaults tuned for high-throughput workloads Based on patterns from Vitess, PlanetScale, and CockroachDB recommendations
Variables ¶
var ( ErrObjectNotFound = fmt.Errorf("object not found") ErrBucketNotFound = fmt.Errorf("bucket not found") )
Common errors
var ( ErrUploadNotFound = fmt.Errorf("multipart upload not found") ErrPartNotFound = fmt.Errorf("part not found") )
Common multipart errors
var ( ErrACLNotFound = fmt.Errorf("ACL not found") ErrPolicyNotFound = fmt.Errorf("policy not found") )
Common ACL/Policy errors
var ( ErrCORSNotFound = fmt.Errorf("CORS configuration not found") ErrWebsiteNotFound = fmt.Errorf("website configuration not found") )
Common CORS/Website errors
var ( ErrTaggingNotFound = fmt.Errorf("tagging not found") ErrEncryptionNotFound = fmt.Errorf("encryption configuration not found") )
Common Tagging/Encryption errors
var ( ErrLifecycleNotFound = fmt.Errorf("lifecycle configuration not found") ErrLifecycleScanStateNotFound = fmt.Errorf("lifecycle scan state not found") ErrObjectLockNotFound = fmt.Errorf("object lock configuration not found") ErrRetentionNotFound = fmt.Errorf("retention not found") ErrLegalHoldNotFound = fmt.Errorf("legal hold not found") ErrPublicAccessBlockNotFound = fmt.Errorf("public access block configuration not found") ErrOwnershipControlsNotFound = fmt.Errorf("ownership controls not found") ErrNotificationNotFound = fmt.Errorf("notification configuration not found") )
Common Lifecycle/ObjectLock errors
var (
ErrChunkNotFound = fmt.Errorf("chunk not found in registry")
)
Common ChunkRegistry errors
var (
ErrFederationNotFound = fmt.Errorf("federation configuration not found")
)
Common Federation errors
var (
ErrIntelligentTieringNotFound = fmt.Errorf("intelligent tiering configuration not found")
)
Common Intelligent Tiering errors
var (
ErrReplicationNotFound = fmt.Errorf("replication configuration not found")
)
Common Replication errors
Functions ¶
func DBMetrics ¶
func DBMetrics() []prometheus.Collector
DBMetrics returns the Prometheus collectors for DB metrics
func IterBuckets ¶
func IterBuckets(ctx context.Context, store BucketStore, params *ListBucketsParams) iter.Seq2[*types.BucketInfo, error]
IterBuckets returns an iterator that yields all buckets from the database. This is more memory-efficient than ListBuckets as it streams results. The iterator handles pagination internally.
func IterObjects ¶
func IterObjects(ctx context.Context, store ObjectStore, params *ListObjectsParams) iter.Seq2[*types.ObjectRef, error]
IterObjects returns an iterator that yields all objects from a bucket. This is more memory-efficient than ListObjectsV2 as it streams results. The iterator handles pagination internally.
func ObjectRefFromJSON ¶
func ObjectRefFromJSON(j *ObjectRefJSON) (*types.ObjectRef, error)
ObjectRefFromJSON converts JSON form back to ObjectRef
func RunMigrations ¶
RunMigrations applies all pending migrations for the specified driver
func UpdateConnectionMetrics ¶
func UpdateConnectionMetrics(inUse, idle, total int)
UpdateConnectionMetrics updates connection pool metrics from sql.DBStats
Types ¶
type ACLStore ¶
type ACLStore interface {
// GetBucketACL retrieves the ACL for a bucket
GetBucketACL(ctx context.Context, bucket string) (*s3types.AccessControlList, error)
// SetBucketACL stores the ACL for a bucket
SetBucketACL(ctx context.Context, bucket string, acl *s3types.AccessControlList) error
// GetObjectACL retrieves the ACL for an object
GetObjectACL(ctx context.Context, bucket, key string) (*s3types.AccessControlList, error)
// SetObjectACL stores the ACL for an object
SetObjectACL(ctx context.Context, bucket, key string, acl *s3types.AccessControlList) error
}
ACLStore provides operations for access control lists
type BucketLoggingConfig ¶
type BucketLoggingConfig struct {
ID string
SourceBucket string
TargetBucket string
TargetPrefix string
CreatedAt time.Time
UpdatedAt time.Time
}
BucketLoggingConfig holds the logging configuration for a bucket.
type BucketStore ¶
type BucketStore interface {
// CreateBucket creates a new bucket
CreateBucket(ctx context.Context, bucket *types.BucketInfo) error
// GetBucket retrieves bucket metadata by name
GetBucket(ctx context.Context, name string) (*types.BucketInfo, error)
// DeleteBucket removes a bucket (must be empty)
DeleteBucket(ctx context.Context, name string) error
// ListBuckets returns buckets with full pagination support
ListBuckets(ctx context.Context, params *ListBucketsParams) (*ListBucketsResult, error)
// UpdateBucketVersioning updates the versioning state of a bucket
UpdateBucketVersioning(ctx context.Context, bucket string, versioning string) error
// CountBuckets returns the total number of buckets in the database.
// Used by metadata service to report bucket count to manager for data loss detection.
CountBuckets(ctx context.Context) (int64, error)
}
BucketStore provides CRUD operations for bucket metadata
type CORSStore ¶
type CORSStore interface {
// GetBucketCORS retrieves the CORS configuration for a bucket
GetBucketCORS(ctx context.Context, bucket string) (*s3types.CORSConfiguration, error)
// SetBucketCORS stores the CORS configuration for a bucket
SetBucketCORS(ctx context.Context, bucket string, cors *s3types.CORSConfiguration) error
// DeleteBucketCORS removes the CORS configuration for a bucket
DeleteBucketCORS(ctx context.Context, bucket string) error
}
CORSStore provides operations for CORS configurations
type ChunkRegistryStore ¶
type ChunkRegistryStore interface {
// IncrementChunkRefCount increments the reference count for a chunk.
// If the chunk doesn't exist, it creates it with ref_count=1.
// Clears zero_ref_since if the chunk was previously at ref_count=0.
IncrementChunkRefCount(ctx context.Context, chunkID string, size int64) error
// DecrementChunkRefCount decrements the reference count for a chunk.
// If ref_count reaches 0, sets zero_ref_since to current time for GC grace period.
DecrementChunkRefCount(ctx context.Context, chunkID string) error
// IncrementChunkRefCountBatch increments ref counts for multiple chunks atomically.
IncrementChunkRefCountBatch(ctx context.Context, chunks []ChunkInfo) error
// DecrementChunkRefCountBatch decrements ref counts for multiple chunks atomically.
DecrementChunkRefCountBatch(ctx context.Context, chunkIDs []string) error
// GetChunkRefCount returns the current reference count for a chunk.
// Used by GC to re-check ref count within a transaction before deleting.
GetChunkRefCount(ctx context.Context, chunkID string) (int, error)
// AddChunkReplica records that a chunk exists on a specific file server.
AddChunkReplica(ctx context.Context, chunkID, serverID, backendID string) error
// RemoveChunkReplica removes the record of a chunk on a file server.
RemoveChunkReplica(ctx context.Context, chunkID, serverID string) error
// GetChunkReplicas returns all replica locations for a chunk.
GetChunkReplicas(ctx context.Context, chunkID string) ([]ReplicaInfo, error)
// GetChunksByServer returns all chunk IDs stored on a specific server.
// Used for server decommissioning and rebalancing.
GetChunksByServer(ctx context.Context, serverID string) ([]string, error)
// GetZeroRefChunks returns chunks with ref_count=0 where zero_ref_since is older
// than the given time (past the grace period). Includes replica info for deletion.
GetZeroRefChunks(ctx context.Context, olderThan time.Time, limit int) ([]ZeroRefChunk, error)
// DeleteChunkRegistry removes a chunk from the registry.
// The chunk_replicas entries are automatically deleted via CASCADE.
DeleteChunkRegistry(ctx context.Context, chunkID string) error
}
ChunkRegistryStore provides operations for centralized chunk reference counting. This eliminates the need for distributed gc_decrement tasks by tracking RefCount in the metadata database rather than on individual file servers.
type Config ¶
type Config struct {
// Driver specifies the database backend (memory, vitess, mysql, postgres, cockroachdb)
Driver Driver
// DSN is the data source name for SQL databases
// Format varies by driver:
// - vitess/mysql: "user:pass@tcp(host:port)/database"
// - postgres: "postgres://user:pass@host:port/database?sslmode=disable"
// - cockroachdb: "postgres://user:pass@host:port/database?sslmode=disable"
DSN string
// Connection pool settings
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime int // seconds
ConnMaxIdleTime int // seconds
}
Config holds database configuration
func DefaultConfig ¶
DefaultConfig returns a Config with sensible defaults for the given driver
type DB ¶
type DB interface {
// Object operations
ObjectStore
// Bucket operations
BucketStore
// Multipart upload operations
MultipartStore
// Version operations
VersionStore
// ACL operations
ACLStore
// Policy operations
PolicyStore
// CORS operations
CORSStore
// Website operations
WebsiteStore
// Tagging operations
TaggingStore
// Encryption operations
EncryptionStore
// Lifecycle operations
LifecycleStore
// Lifecycle scanner state
LifecycleScanStore
// Intelligent Tiering operations
IntelligentTieringStore
// Object Lock operations
ObjectLockStore
// Public Access Block operations
PublicAccessBlockStore
// Ownership Controls operations
OwnershipControlsStore
// Bucket Logging operations (access log configuration)
LoggingStore
// Notification operations (event notifications)
NotificationStore
// Replication operations (cross-region replication - Enterprise)
ReplicationStore
// Federation operations (S3 passthrough/migration)
FederationStore
// Chunk registry operations (centralized RefCount tracking)
ChunkRegistryStore
// Transaction support - executes fn within a transaction.
// If fn returns an error, the transaction is rolled back.
// If fn returns nil, the transaction is committed.
WithTx(ctx context.Context, fn func(tx TxStore) error) error
// Migrations
Migrate(ctx context.Context) error
// Close closes the database connection
Close() error
}
DB is the main database interface for the metadata service
func NewMetricsDB ¶
NewMetricsDB creates a new metrics-instrumented DB wrapper
type EncryptionStore ¶
type EncryptionStore interface {
// GetBucketEncryption retrieves the encryption config for a bucket
GetBucketEncryption(ctx context.Context, bucket string) (*s3types.ServerSideEncryptionConfig, error)
// SetBucketEncryption stores the encryption config for a bucket
SetBucketEncryption(ctx context.Context, bucket string, config *s3types.ServerSideEncryptionConfig) error
// DeleteBucketEncryption removes the encryption config for a bucket
DeleteBucketEncryption(ctx context.Context, bucket string) error
}
EncryptionStore provides operations for bucket encryption configurations
type FederationStore ¶
type FederationStore interface {
// GetFederationConfig retrieves the federation config for a bucket.
// Returns ErrFederationNotFound if no configuration exists.
GetFederationConfig(ctx context.Context, bucket string) (*s3types.FederationConfig, error)
// SetFederationConfig stores or updates the federation config for a bucket.
SetFederationConfig(ctx context.Context, config *s3types.FederationConfig) error
// DeleteFederationConfig removes the federation config for a bucket.
DeleteFederationConfig(ctx context.Context, bucket string) error
// ListFederatedBuckets returns all buckets with federation configurations.
ListFederatedBuckets(ctx context.Context) ([]*s3types.FederationConfig, error)
// UpdateMigrationProgress updates the migration progress counters for a bucket.
// This is called frequently during migration and only updates the progress fields.
UpdateMigrationProgress(ctx context.Context, bucket string, objectsSynced, bytesSynced int64, lastSyncKey string) error
// SetMigrationPaused sets the migration_paused flag for a bucket.
SetMigrationPaused(ctx context.Context, bucket string, paused bool) error
// SetDualWriteEnabled sets the dual_write_enabled flag for a bucket.
SetDualWriteEnabled(ctx context.Context, bucket string, enabled bool) error
// GetFederatedBucketsNeedingSync returns buckets that are in migrating mode and not paused.
// Used by migration workers to find work.
GetFederatedBucketsNeedingSync(ctx context.Context, limit int) ([]*s3types.FederationConfig, error)
}
FederationStore provides operations for S3 bucket federation configurations. Used for passthrough mode (proxy to external S3) and migration mode (ingest from external S3).
type IntelligentTieringStore ¶
type IntelligentTieringStore interface {
// GetIntelligentTieringConfiguration retrieves a configuration by ID
GetIntelligentTieringConfiguration(ctx context.Context, bucket, configID string) (*s3types.IntelligentTieringConfiguration, error)
// PutIntelligentTieringConfiguration stores a configuration
PutIntelligentTieringConfiguration(ctx context.Context, bucket string, config *s3types.IntelligentTieringConfiguration) error
// DeleteIntelligentTieringConfiguration removes a configuration by ID
DeleteIntelligentTieringConfiguration(ctx context.Context, bucket, configID string) error
// ListIntelligentTieringConfigurations lists all configurations for a bucket
ListIntelligentTieringConfigurations(ctx context.Context, bucket string) ([]*s3types.IntelligentTieringConfiguration, error)
}
IntelligentTieringStore provides operations for intelligent tiering configurations
type LifecycleScanState ¶
type LifecycleScanState struct {
Bucket string
LastKey string
LastVersionID string
ScanStartedAt time.Time
ScanCompletedAt time.Time
ObjectsScanned int
ActionsEnqueued int
LastError string
ConsecutiveErrors int
}
LifecycleScanState tracks scan progress for a bucket
type LifecycleScanStore ¶
type LifecycleScanStore interface {
// GetScanState retrieves scan state for a bucket
GetScanState(ctx context.Context, bucket string) (*LifecycleScanState, error)
// UpdateScanState updates scan progress (upsert)
UpdateScanState(ctx context.Context, state *LifecycleScanState) error
// ListBucketsWithLifecycle returns buckets that have lifecycle configs
ListBucketsWithLifecycle(ctx context.Context) ([]string, error)
// GetBucketsNeedingScan returns buckets that need scanning
// (completed scan older than minAge, or never scanned)
GetBucketsNeedingScan(ctx context.Context, minAge time.Duration, limit int) ([]string, error)
// ResetScanState clears scan state for a bucket (for fresh start)
ResetScanState(ctx context.Context, bucket string) error
}
LifecycleScanStore tracks lifecycle scanner progress
type LifecycleStore ¶
type LifecycleStore interface {
// GetBucketLifecycle retrieves the lifecycle config for a bucket
GetBucketLifecycle(ctx context.Context, bucket string) (*s3types.Lifecycle, error)
// SetBucketLifecycle stores the lifecycle config for a bucket
SetBucketLifecycle(ctx context.Context, bucket string, lifecycle *s3types.Lifecycle) error
// DeleteBucketLifecycle removes the lifecycle config for a bucket
DeleteBucketLifecycle(ctx context.Context, bucket string) error
}
LifecycleStore provides operations for lifecycle configurations
type ListBucketsParams ¶
type ListBucketsParams struct {
OwnerID string
Prefix string // Filter by bucket name prefix
BucketRegion string // Filter by bucket region
MaxBuckets int // Pagination limit (1-10000)
ContinuationToken string // Pagination token
}
ListBucketsParams contains parameters for ListBuckets
type ListBucketsResult ¶
type ListBucketsResult struct {
Buckets []*types.BucketInfo
IsTruncated bool
NextContinuationToken string
}
ListBucketsResult contains the result of ListBuckets
type ListObjectsParams ¶
type ListObjectsParams struct {
Bucket string
Prefix string
Delimiter string
MaxKeys int
Marker string // For ListObjects v1
ContinuationToken string // For ListObjects v2
StartAfter string // For ListObjects v2
FetchOwner bool
}
ListObjectsParams contains parameters for ListObjectsV2
type ListObjectsResult ¶
type ListObjectsResult struct {
Objects []*types.ObjectRef
CommonPrefixes []string // Aggregated prefixes when delimiter is used
IsTruncated bool
NextMarker string // For v1
NextContinuationToken string // For v2
}
ListObjectsResult contains the result of ListObjectsV2
type LoggingStore ¶
type LoggingStore interface {
// GetBucketLogging retrieves the logging configuration for a bucket.
// Returns nil, nil if no logging is configured.
GetBucketLogging(ctx context.Context, bucket string) (*BucketLoggingConfig, error)
// SetBucketLogging stores the logging configuration for a bucket.
// If config.TargetBucket is empty, logging is disabled for the bucket.
SetBucketLogging(ctx context.Context, config *BucketLoggingConfig) error
// DeleteBucketLogging removes the logging configuration for a bucket.
DeleteBucketLogging(ctx context.Context, bucket string) error
// ListLoggingConfigs returns all bucket logging configurations.
ListLoggingConfigs(ctx context.Context) ([]*BucketLoggingConfig, error)
}
LoggingStore provides operations for bucket access logging configuration.
type MetricsDB ¶
type MetricsDB struct {
// contains filtered or unexported fields
}
MetricsDB wraps a DB implementation and adds metrics instrumentation
func (*MetricsDB) AddChunkReplica ¶
func (*MetricsDB) CompleteRestore ¶
func (*MetricsDB) CountBuckets ¶
func (*MetricsDB) CreateBucket ¶
func (*MetricsDB) CreateMultipartUpload ¶
func (*MetricsDB) DecrementChunkRefCount ¶
func (*MetricsDB) DecrementChunkRefCountBatch ¶
func (*MetricsDB) DeleteBucket ¶
func (*MetricsDB) DeleteBucketCORS ¶
func (*MetricsDB) DeleteBucketEncryption ¶
func (*MetricsDB) DeleteBucketLifecycle ¶
func (*MetricsDB) DeleteBucketLogging ¶
func (*MetricsDB) DeleteBucketPolicy ¶
func (*MetricsDB) DeleteBucketTagging ¶
func (*MetricsDB) DeleteBucketWebsite ¶
func (*MetricsDB) DeleteChunkRegistry ¶
func (*MetricsDB) DeleteFederationConfig ¶
func (*MetricsDB) DeleteIntelligentTieringConfiguration ¶
func (*MetricsDB) DeleteMultipartUpload ¶
func (*MetricsDB) DeleteNotificationConfiguration ¶
func (*MetricsDB) DeleteObject ¶
func (*MetricsDB) DeleteObjectTagging ¶
func (*MetricsDB) DeleteObjectVersion ¶
func (*MetricsDB) DeleteOwnershipControls ¶
func (*MetricsDB) DeleteParts ¶
func (*MetricsDB) DeletePublicAccessBlock ¶
func (*MetricsDB) DeleteReplicationConfiguration ¶
func (*MetricsDB) GetBucketACL ¶
func (*MetricsDB) GetBucketCORS ¶
func (*MetricsDB) GetBucketEncryption ¶
func (*MetricsDB) GetBucketLifecycle ¶
func (*MetricsDB) GetBucketLogging ¶
func (*MetricsDB) GetBucketPolicy ¶
func (*MetricsDB) GetBucketTagging ¶
func (*MetricsDB) GetBucketWebsite ¶
func (*MetricsDB) GetBucketsNeedingScan ¶
func (*MetricsDB) GetChunkRefCount ¶
func (*MetricsDB) GetChunkReplicas ¶
func (*MetricsDB) GetChunksByServer ¶
func (*MetricsDB) GetColdIntelligentTieringObjects ¶
func (*MetricsDB) GetExpiredRestores ¶
func (*MetricsDB) GetFederatedBucketsNeedingSync ¶
func (*MetricsDB) GetFederationConfig ¶
func (*MetricsDB) GetIntelligentTieringConfiguration ¶
func (*MetricsDB) GetMultipartUpload ¶
func (*MetricsDB) GetNotificationConfiguration ¶
func (*MetricsDB) GetObjectACL ¶
func (*MetricsDB) GetObjectByID ¶
func (*MetricsDB) GetObjectLegalHold ¶
func (*MetricsDB) GetObjectLockConfiguration ¶
func (*MetricsDB) GetObjectRetention ¶
func (*MetricsDB) GetObjectTagging ¶
func (*MetricsDB) GetObjectVersion ¶
func (*MetricsDB) GetOwnershipControls ¶
func (*MetricsDB) GetPublicAccessBlock ¶
func (*MetricsDB) GetReplicationConfiguration ¶
func (*MetricsDB) GetScanState ¶
func (*MetricsDB) GetZeroRefChunks ¶
func (*MetricsDB) IncrementChunkRefCount ¶
func (*MetricsDB) IncrementChunkRefCountBatch ¶
func (*MetricsDB) ListBuckets ¶
func (m *MetricsDB) ListBuckets(ctx context.Context, params *ListBucketsParams) (*ListBucketsResult, error)
func (*MetricsDB) ListBucketsWithLifecycle ¶
func (*MetricsDB) ListDeletedObjects ¶
func (*MetricsDB) ListFederatedBuckets ¶
func (*MetricsDB) ListIntelligentTieringConfigurations ¶
func (*MetricsDB) ListLoggingConfigs ¶
func (m *MetricsDB) ListLoggingConfigs(ctx context.Context) ([]*BucketLoggingConfig, error)
func (*MetricsDB) ListMultipartUploads ¶
func (*MetricsDB) ListObjectVersions ¶
func (*MetricsDB) ListObjects ¶
func (*MetricsDB) ListObjectsV2 ¶
func (m *MetricsDB) ListObjectsV2(ctx context.Context, params *ListObjectsParams) (*ListObjectsResult, error)
func (*MetricsDB) MarkObjectDeleted ¶
func (*MetricsDB) PutDeleteMarker ¶
func (*MetricsDB) PutIntelligentTieringConfiguration ¶
func (*MetricsDB) RemoveChunkReplica ¶
func (*MetricsDB) ResetRestoreStatus ¶
func (*MetricsDB) ResetScanState ¶
func (*MetricsDB) SetBucketACL ¶
func (*MetricsDB) SetBucketCORS ¶
func (*MetricsDB) SetBucketEncryption ¶
func (*MetricsDB) SetBucketLifecycle ¶
func (*MetricsDB) SetBucketLogging ¶
func (m *MetricsDB) SetBucketLogging(ctx context.Context, config *BucketLoggingConfig) error
func (*MetricsDB) SetBucketPolicy ¶
func (*MetricsDB) SetBucketTagging ¶
func (*MetricsDB) SetBucketWebsite ¶
func (*MetricsDB) SetDualWriteEnabled ¶
func (*MetricsDB) SetFederationConfig ¶
func (*MetricsDB) SetMigrationPaused ¶
func (*MetricsDB) SetNotificationConfiguration ¶
func (*MetricsDB) SetObjectACL ¶
func (*MetricsDB) SetObjectLegalHold ¶
func (*MetricsDB) SetObjectLockConfiguration ¶
func (*MetricsDB) SetObjectRetention ¶
func (*MetricsDB) SetObjectTagging ¶
func (*MetricsDB) SetOwnershipControls ¶
func (*MetricsDB) SetPublicAccessBlock ¶
func (*MetricsDB) SetReplicationConfiguration ¶
func (*MetricsDB) UpdateBucketVersioning ¶
func (*MetricsDB) UpdateLastAccessedAt ¶
func (*MetricsDB) UpdateMigrationProgress ¶
func (*MetricsDB) UpdateObjectTransition ¶
func (*MetricsDB) UpdateRestoreExpiry ¶
func (*MetricsDB) UpdateRestoreStatus ¶
func (*MetricsDB) UpdateScanState ¶
func (m *MetricsDB) UpdateScanState(ctx context.Context, state *LifecycleScanState) error
type Migration ¶
Migration represents a database migration
func LoadMigrations ¶
LoadMigrations loads all migration files for a specific driver from the embedded filesystem. The driver parameter should be one of: mysql, postgres, cockroachdb. CockroachDB uses the postgres migrations since they're compatible.
type Migrator ¶
type Migrator interface {
// CurrentVersion returns the current migration version
CurrentVersion(ctx context.Context) (int, error)
// Apply applies a migration
Apply(ctx context.Context, m Migration) error
// SetVersion records that a migration has been applied
SetVersion(ctx context.Context, version int) error
}
Migrator handles database migrations
type MultipartStore ¶
type MultipartStore interface {
// CreateMultipartUpload creates a new multipart upload
CreateMultipartUpload(ctx context.Context, upload *types.MultipartUpload) error
// GetMultipartUpload retrieves a multipart upload by upload ID
GetMultipartUpload(ctx context.Context, bucket, key, uploadID string) (*types.MultipartUpload, error)
// DeleteMultipartUpload removes a multipart upload and all its parts
DeleteMultipartUpload(ctx context.Context, bucket, key, uploadID string) error
// ListMultipartUploads lists in-progress uploads for a bucket
ListMultipartUploads(ctx context.Context, bucket, prefix, keyMarker, uploadIDMarker string, maxUploads int) ([]*types.MultipartUpload, bool, error)
// PutPart stores a part of a multipart upload
PutPart(ctx context.Context, part *types.MultipartPart) error
// GetPart retrieves a specific part
GetPart(ctx context.Context, uploadID string, partNumber int) (*types.MultipartPart, error)
// ListParts lists all parts for an upload
ListParts(ctx context.Context, uploadID string, partNumberMarker, maxParts int) ([]*types.MultipartPart, bool, error)
// DeleteParts removes all parts for an upload
DeleteParts(ctx context.Context, uploadID string) error
}
MultipartStore provides operations for multipart uploads
type NotificationStore ¶
type NotificationStore interface {
// GetNotificationConfiguration retrieves the notification config for a bucket.
// Returns nil, nil if no configuration exists.
GetNotificationConfiguration(ctx context.Context, bucket string) (*s3types.NotificationConfiguration, error)
// SetNotificationConfiguration stores the notification config for a bucket.
SetNotificationConfiguration(ctx context.Context, bucket string, config *s3types.NotificationConfiguration) error
// DeleteNotificationConfiguration removes the notification config for a bucket.
DeleteNotificationConfiguration(ctx context.Context, bucket string) error
}
NotificationStore provides operations for bucket notification configurations.
type ObjectLockStore ¶
type ObjectLockStore interface {
// GetObjectLockConfiguration retrieves the Object Lock config for a bucket
GetObjectLockConfiguration(ctx context.Context, bucket string) (*s3types.ObjectLockConfiguration, error)
// SetObjectLockConfiguration stores the Object Lock config for a bucket
SetObjectLockConfiguration(ctx context.Context, bucket string, config *s3types.ObjectLockConfiguration) error
// GetObjectRetention retrieves the retention settings for an object
GetObjectRetention(ctx context.Context, bucket, key string) (*s3types.ObjectLockRetention, error)
// SetObjectRetention stores the retention settings for an object
SetObjectRetention(ctx context.Context, bucket, key string, retention *s3types.ObjectLockRetention) error
// GetObjectLegalHold retrieves the legal hold status for an object
GetObjectLegalHold(ctx context.Context, bucket, key string) (*s3types.ObjectLockLegalHold, error)
// SetObjectLegalHold stores the legal hold status for an object
SetObjectLegalHold(ctx context.Context, bucket, key string, legalHold *s3types.ObjectLockLegalHold) error
}
ObjectLockStore provides operations for Object Lock (WORM) configurations
type ObjectRefJSON ¶
type ObjectRefJSON struct {
ID string `json:"id"`
Bucket string `json:"bucket"`
Key string `json:"key"`
Size uint64 `json:"size"`
Version uint64 `json:"version"`
ETag string `json:"etag"`
CreatedAt int64 `json:"created_at"`
DeletedAt int64 `json:"deleted_at,omitempty"`
ProfileID string `json:"profile_id,omitempty"`
ChunkRefs string `json:"chunk_refs,omitempty"` // JSON-encoded []ChunkRef
ECGroupIDs string `json:"ec_group_ids,omitempty"` // JSON-encoded []uuid.UUID
}
ObjectRefJSON is used for JSON serialization in SQL databases
func ObjectRefToJSON ¶
func ObjectRefToJSON(obj *types.ObjectRef) (*ObjectRefJSON, error)
ObjectRefToJSON converts ObjectRef to JSON-serializable form
type ObjectStore ¶
type ObjectStore interface {
// PutObject stores or updates object metadata
PutObject(ctx context.Context, obj *types.ObjectRef) error
// GetObject retrieves object metadata by bucket and key
GetObject(ctx context.Context, bucket, key string) (*types.ObjectRef, error)
// GetObjectByID retrieves object metadata by ID
GetObjectByID(ctx context.Context, id uuid.UUID) (*types.ObjectRef, error)
// DeleteObject removes object metadata (hard delete)
DeleteObject(ctx context.Context, bucket, key string) error
// MarkObjectDeleted sets the deleted timestamp (soft delete)
MarkObjectDeleted(ctx context.Context, bucket, key string, deletedAt int64) error
// ListObjects returns objects in a bucket with optional prefix filter.
// This is a convenience method that wraps ListObjectsV2 for simple use cases.
// For full pagination support, use ListObjectsV2 directly.
ListObjects(ctx context.Context, bucket, prefix string, limit int) ([]*types.ObjectRef, error)
// ListObjectsV2 returns objects with full pagination support
ListObjectsV2(ctx context.Context, params *ListObjectsParams) (*ListObjectsResult, error)
// ListDeletedObjects returns soft-deleted objects for GC
ListDeletedObjects(ctx context.Context, olderThan int64, limit int) ([]*types.ObjectRef, error)
// UpdateObjectTransition updates an object's storage class and transition metadata.
// Used by lifecycle transitions to record that an object has been moved to tier storage.
// Parameters:
// - objectID: the UUID of the object to update
// - storageClass: the new storage class (e.g., "GLACIER", "DEEP_ARCHIVE")
// - transitionedAt: Unix timestamp (nanos) when the transition occurred
// - transitionedRef: the key in the tier backend where the object data is stored
UpdateObjectTransition(ctx context.Context, objectID string, storageClass string, transitionedAt int64, transitionedRef string) error
// UpdateRestoreStatus updates the restore status for an archived object.
// Called when a restore is initiated or when status changes during restore.
UpdateRestoreStatus(ctx context.Context, objectID string, status string, tier string, requestedAt int64) error
// UpdateRestoreExpiry extends the expiry date of a restored object copy.
// Used when a restore request is made on an already-restored object to extend availability.
UpdateRestoreExpiry(ctx context.Context, objectID string, expiryDate int64) error
// CompleteRestore marks a restore as complete and updates the object with restored copy info.
// The restoredChunkRefs are the chunk references for the restored copy in hot storage.
CompleteRestore(ctx context.Context, objectID string, expiryDate int64) error
// ResetRestoreStatus clears the restore status after a restored copy expires.
// Called by the restore cleanup job when restore_expiry_date has passed.
ResetRestoreStatus(ctx context.Context, objectID string) error
// GetExpiredRestores returns objects with expired restore copies for cleanup.
// Returns up to 'limit' objects where restore_status='completed' and restore_expiry_date < now.
GetExpiredRestores(ctx context.Context, now int64, limit int) ([]*types.ObjectRef, error)
// UpdateLastAccessedAt updates the last access timestamp for an object.
// Called asynchronously on GET for intelligent tiering to track access patterns.
UpdateLastAccessedAt(ctx context.Context, objectID string, accessedAt int64) error
// GetColdIntelligentTieringObjects returns objects with INTELLIGENT_TIERING storage class
// that haven't been accessed since the threshold time, for automatic demotion.
// Returns up to 'limit' objects where:
// - storage_class = 'INTELLIGENT_TIERING'
// - (last_accessed_at < threshold OR (last_accessed_at = 0 AND created_at < threshold))
// - size >= minSize (to skip small objects, AWS uses 128KB)
GetColdIntelligentTieringObjects(ctx context.Context, threshold int64, minSize int64, limit int) ([]*types.ObjectRef, error)
}
ObjectStore provides CRUD operations for object metadata
type OwnershipControlsStore ¶
type OwnershipControlsStore interface {
// GetOwnershipControls retrieves the ownership controls for a bucket
GetOwnershipControls(ctx context.Context, bucket string) (*s3types.OwnershipControls, error)
// SetOwnershipControls stores the ownership controls for a bucket
SetOwnershipControls(ctx context.Context, bucket string, controls *s3types.OwnershipControls) error
// DeleteOwnershipControls removes the ownership controls for a bucket
DeleteOwnershipControls(ctx context.Context, bucket string) error
}
OwnershipControlsStore provides operations for bucket ownership controls
type PolicyStore ¶
type PolicyStore interface {
// GetBucketPolicy retrieves the policy for a bucket
GetBucketPolicy(ctx context.Context, bucket string) (*s3types.BucketPolicy, error)
// SetBucketPolicy stores the policy for a bucket
SetBucketPolicy(ctx context.Context, bucket string, policy *s3types.BucketPolicy) error
// DeleteBucketPolicy removes the policy for a bucket
DeleteBucketPolicy(ctx context.Context, bucket string) error
}
PolicyStore provides operations for bucket policies
type PublicAccessBlockStore ¶
type PublicAccessBlockStore interface {
// GetPublicAccessBlock retrieves the public access block config for a bucket
GetPublicAccessBlock(ctx context.Context, bucket string) (*s3types.PublicAccessBlockConfig, error)
// SetPublicAccessBlock stores the public access block config for a bucket
SetPublicAccessBlock(ctx context.Context, bucket string, config *s3types.PublicAccessBlockConfig) error
// DeletePublicAccessBlock removes the public access block config for a bucket
DeletePublicAccessBlock(ctx context.Context, bucket string) error
}
PublicAccessBlockStore provides operations for public access block configurations
type ReplicaInfo ¶
ReplicaInfo contains information about a chunk replica location
type ReplicationStore ¶
type ReplicationStore interface {
// GetReplicationConfiguration retrieves the replication config for a bucket.
// Returns ErrReplicationNotFound if no configuration exists.
GetReplicationConfiguration(ctx context.Context, bucket string) (*s3types.ReplicationConfiguration, error)
// SetReplicationConfiguration stores the replication config for a bucket.
SetReplicationConfiguration(ctx context.Context, bucket string, config *s3types.ReplicationConfiguration) error
// DeleteReplicationConfiguration removes the replication config for a bucket.
DeleteReplicationConfiguration(ctx context.Context, bucket string) error
}
ReplicationStore provides operations for bucket replication configurations (Enterprise).
type TaggingStore ¶
type TaggingStore interface {
// GetBucketTagging retrieves the tag set for a bucket
GetBucketTagging(ctx context.Context, bucket string) (*s3types.TagSet, error)
// SetBucketTagging stores the tag set for a bucket
SetBucketTagging(ctx context.Context, bucket string, tagSet *s3types.TagSet) error
// DeleteBucketTagging removes the tag set for a bucket
DeleteBucketTagging(ctx context.Context, bucket string) error
// GetObjectTagging retrieves the tag set for an object
GetObjectTagging(ctx context.Context, bucket, key string) (*s3types.TagSet, error)
// SetObjectTagging stores the tag set for an object
SetObjectTagging(ctx context.Context, bucket, key string, tagSet *s3types.TagSet) error
// DeleteObjectTagging removes the tag set for an object
DeleteObjectTagging(ctx context.Context, bucket, key string) error
}
TaggingStore provides operations for resource tagging
type TxStore ¶
type TxStore interface {
ObjectStore
BucketStore
MultipartStore
ChunkRegistryStore
}
TxStore provides transactional access to object and bucket stores. All operations within a transaction are atomic.
type VersionStore ¶
type VersionStore interface {
// ListObjectVersions lists all versions of objects in a bucket
// Returns: versions, isTruncated, nextKeyMarker, nextVersionIDMarker, error
ListObjectVersions(ctx context.Context, bucket, prefix, keyMarker, versionIDMarker, delimiter string, maxKeys int) ([]*types.ObjectVersion, bool, string, string, error)
// GetObjectVersion retrieves a specific version of an object
GetObjectVersion(ctx context.Context, bucket, key, versionID string) (*types.ObjectRef, error)
// DeleteObjectVersion permanently deletes a specific version
DeleteObjectVersion(ctx context.Context, bucket, key, versionID string) error
// PutDeleteMarker creates a delete marker for an object (versioning enabled)
PutDeleteMarker(ctx context.Context, bucket, key, ownerID string) (versionID string, err error)
}
VersionStore provides operations for object versioning
type WebsiteStore ¶
type WebsiteStore interface {
// GetBucketWebsite retrieves the website configuration for a bucket
GetBucketWebsite(ctx context.Context, bucket string) (*s3types.WebsiteConfiguration, error)
// SetBucketWebsite stores the website configuration for a bucket
SetBucketWebsite(ctx context.Context, bucket string, website *s3types.WebsiteConfiguration) error
// DeleteBucketWebsite removes the website configuration for a bucket
DeleteBucketWebsite(ctx context.Context, bucket string) error
}
WebsiteStore provides operations for website configurations
type ZeroRefChunk ¶
type ZeroRefChunk struct {
ChunkID string
Size int64
Replicas []ReplicaInfo
}
ZeroRefChunk contains a chunk with zero references and its replicas (for GC)
Directories
¶
| Path | Synopsis |
|---|---|
|
Package memory provides an in-memory implementation of db.DB for testing.
|
Package memory provides an in-memory implementation of db.DB for testing. |
|
Package postgres provides a PostgreSQL/CockroachDB implementation of the db.DB interface.
|
Package postgres provides a PostgreSQL/CockroachDB implementation of the db.DB interface. |
|
Package sql provides a dialect-aware SQL database implementation.
|
Package sql provides a dialect-aware SQL database implementation. |
|
Package vitess provides a Vitess/MySQL implementation of the db.DB interface.
|
Package vitess provides a Vitess/MySQL implementation of the db.DB interface. |