
store
Index
- type PostgresStore
- func NewPostgres(ctx context.Context, cfg *config.DatabaseConfig) (*PostgresStore, error)
- func (s *PostgresStore) Close() error
- func (s *PostgresStore) DeleteObject(ctx context.Context, bucket, key string) error
- func (s *PostgresStore) GetBucket(ctx context.Context, name string) (*backend.BucketRecord, error)
- func (s *PostgresStore) GetObject(ctx context.Context, bucket, key string) (*backend.ObjectRecord, error)
- func (s *PostgresStore) ListBuckets(ctx context.Context) ([]*backend.BucketRecord, error)
- func (s *PostgresStore) ListObjects(ctx context.Context, bucket, prefix, startAfter string, maxKeys int) ([]*backend.ObjectRecord, error)
- func (s *PostgresStore) PutBucket(ctx context.Context, rec *backend.BucketRecord) error
- func (s *PostgresStore) PutObject(ctx context.Context, rec *backend.ObjectRecord) error
- type SQLiteStore
- func NewSQLite(path string) (*SQLiteStore, error)
- func (s *SQLiteStore) Close() error
- func (s *SQLiteStore) DeleteObject(ctx context.Context, bucket, key string) error
- func (s *SQLiteStore) GetBucket(ctx context.Context, name string) (*backend.BucketRecord, error)
- func (s *SQLiteStore) GetObject(ctx context.Context, bucket, key string) (*backend.ObjectRecord, error)
- func (s *SQLiteStore) ListBuckets(ctx context.Context) ([]*backend.BucketRecord, error)
- func (s *SQLiteStore) ListObjects(ctx context.Context, bucket, prefix, startAfter string, maxKeys int) ([]*backend.ObjectRecord, error)
- func (s *SQLiteStore) PutBucket(ctx context.Context, rec *backend.BucketRecord) error
- func (s *SQLiteStore) PutObject(ctx context.Context, rec *backend.ObjectRecord) error
type PostgresStore
PostgresStore provides a shared PostgreSQL metadata index for g3 objects and buckets. Implements backend.MetadataStore.
func NewPostgres
NewPostgres connects to PostgreSQL, runs migrations, and returns a store.
func (*PostgresStore) Close
Close closes the connection pool.
func (*PostgresStore) DeleteObject
DeleteObject removes an object record from the index.
func (*PostgresStore) GetBucket
GetBucket retrieves a bucket record by name. Returns nil if not found.
func (*PostgresStore) GetObject
GetObject retrieves an object record by bucket and key. Returns nil if not found.
func (*PostgresStore) ListBuckets
ListBuckets returns all bucket records ordered by name.
func (*PostgresStore) ListObjects
ListObjects returns object records matching a bucket and optional key prefix, ordered by key.
func (*PostgresStore) PutBucket
PutBucket inserts or replaces a bucket record.
func (*PostgresStore) PutObject
PutObject inserts or replaces an object record.
type SQLiteStore
SQLiteStore provides a local SQLite metadata index for g3 objects and buckets. Implements backend.MetadataStore.
func NewSQLite
New opens or creates a SQLite database at the given path and runs schema migrations.
func (*SQLiteStore) Close
Close closes the database connection.
func (*SQLiteStore) DeleteObject
DeleteObject removes an object record from the index.
func (*SQLiteStore) GetBucket
GetBucket retrieves a bucket record by name. Returns nil if not found.
func (*SQLiteStore) GetObject
GetObject retrieves an object record by bucket and key. Returns nil if not found.
func (*SQLiteStore) ListBuckets
ListBuckets returns all bucket records ordered by name.
func (*SQLiteStore) ListObjects
ListObjects returns object records matching a bucket and optional key prefix, ordered by key.
func (*SQLiteStore) PutBucket
PutBucket inserts or replaces a bucket record.
func (*SQLiteStore) PutObject
PutObject inserts or replaces an object record in the index.
Generated by gomarkdoc