mongo

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mongo implements the Trove store interface using MongoDB via Grove ORM.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

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

Store implements store.Store using MongoDB via Grove ORM.

func New

func New(db *grove.DB) *Store

New creates a new MongoDB store backed by Grove ORM.

func (*Store) Close

func (s *Store) Close() error

Close closes the database connection.

func (*Store) CreateBucket

func (s *Store) CreateBucket(ctx context.Context, b *model.Bucket) error

func (*Store) CreateObject

func (s *Store) CreateObject(ctx context.Context, o *model.Object) error

func (*Store) CreateUploadSession

func (s *Store) CreateUploadSession(ctx context.Context, u *model.UploadSession) error

func (*Store) DB

func (s *Store) DB() *grove.DB

DB returns the underlying grove database for direct access.

func (*Store) DecrementCASRef

func (s *Store) DecrementCASRef(ctx context.Context, hash string) error

func (*Store) DeleteBucket

func (s *Store) DeleteBucket(ctx context.Context, id string) error

func (*Store) DeleteCASEntry

func (s *Store) DeleteCASEntry(ctx context.Context, hash string) error

func (*Store) DeleteQuota

func (s *Store) DeleteQuota(ctx context.Context, tenantKey string) error

func (*Store) GetBucket

func (s *Store) GetBucket(ctx context.Context, id string) (*model.Bucket, error)

func (*Store) GetBucketByName

func (s *Store) GetBucketByName(ctx context.Context, name string) (*model.Bucket, error)

func (*Store) GetCASEntry

func (s *Store) GetCASEntry(ctx context.Context, hash string) (*model.CASEntry, error)

func (*Store) GetObject

func (s *Store) GetObject(ctx context.Context, id string) (*model.Object, error)

func (*Store) GetObjectByKey

func (s *Store) GetObjectByKey(ctx context.Context, bucketID, key string) (*model.Object, error)

func (*Store) GetQuota

func (s *Store) GetQuota(ctx context.Context, tenantKey string) (*model.Quota, error)

func (*Store) GetUploadSession

func (s *Store) GetUploadSession(ctx context.Context, id string) (*model.UploadSession, error)

func (*Store) IncrementCASRef

func (s *Store) IncrementCASRef(ctx context.Context, hash string) error

func (*Store) ListAllObjects

func (s *Store) ListAllObjects(ctx context.Context, limit int) ([]*model.Object, error)

func (*Store) ListBuckets

func (s *Store) ListBuckets(ctx context.Context, tenantKey string) ([]*model.Bucket, error)

func (*Store) ListCASEntries

func (s *Store) ListCASEntries(ctx context.Context) ([]*model.CASEntry, error)

func (*Store) ListExpiredUploads

func (s *Store) ListExpiredUploads(ctx context.Context) ([]*model.UploadSession, error)

func (*Store) ListObjects

func (s *Store) ListObjects(ctx context.Context, bucketID string, opts ...store.ListOption) ([]*model.Object, error)

func (*Store) ListQuotas

func (s *Store) ListQuotas(ctx context.Context) ([]*model.Quota, error)

func (*Store) ListUnpinnedCAS

func (s *Store) ListUnpinnedCAS(ctx context.Context) ([]*model.CASEntry, error)

func (*Store) ListUploads

func (s *Store) ListUploads(ctx context.Context) ([]*model.UploadSession, error)

func (*Store) Migrate

func (s *Store) Migrate(ctx context.Context, _ ...*migrate.Group) error

Migrate creates indexes for all trove collections.

func (*Store) Ping

func (s *Store) Ping(ctx context.Context) error

Ping checks database connectivity.

func (*Store) PutCASEntry

func (s *Store) PutCASEntry(ctx context.Context, entry *model.CASEntry) error

func (*Store) SetCASPinned

func (s *Store) SetCASPinned(ctx context.Context, hash string, pinned bool) error

func (*Store) SetQuota

func (s *Store) SetQuota(ctx context.Context, q *model.Quota) error

func (*Store) SoftDeleteObject

func (s *Store) SoftDeleteObject(ctx context.Context, id string) error

func (*Store) UpdateBucket

func (s *Store) UpdateBucket(ctx context.Context, b *model.Bucket) error

func (*Store) UpdateObject

func (s *Store) UpdateObject(ctx context.Context, o *model.Object) error

func (*Store) UpdateQuotaUsage

func (s *Store) UpdateQuotaUsage(ctx context.Context, tenantKey string, deltaBytes, deltaObjects int64) error

func (*Store) UpdateUploadSession

func (s *Store) UpdateUploadSession(ctx context.Context, u *model.UploadSession) error

Jump to

Keyboard shortcuts

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