blob.go raw

   1  package neo4j
   2  
   3  import (
   4  	"errors"
   5  
   6  	"next.orly.dev/pkg/database"
   7  )
   8  
   9  // Blob storage methods - Neo4j does not support blob storage
  10  // These are stub implementations that return errors
  11  
  12  var errBlobNotSupported = errors.New("blob storage not supported in Neo4j backend")
  13  
  14  // SaveBlob stores a blob with its metadata (not supported in Neo4j)
  15  func (n *N) SaveBlob(sha256Hash []byte, data []byte, pubkey []byte, mimeType string, extension string) error {
  16  	return errBlobNotSupported
  17  }
  18  
  19  // SaveBlobMetadata stores only metadata for a blob (not supported in Neo4j)
  20  func (n *N) SaveBlobMetadata(sha256Hash []byte, size int64, pubkey []byte, mimeType string, extension string) error {
  21  	return errBlobNotSupported
  22  }
  23  
  24  // GetBlob retrieves blob data by SHA256 hash (not supported in Neo4j)
  25  func (n *N) GetBlob(sha256Hash []byte) (data []byte, metadata *database.BlobMetadata, err error) {
  26  	return nil, nil, errBlobNotSupported
  27  }
  28  
  29  // HasBlob checks if a blob exists (not supported in Neo4j)
  30  func (n *N) HasBlob(sha256Hash []byte) (exists bool, err error) {
  31  	return false, errBlobNotSupported
  32  }
  33  
  34  // DeleteBlob deletes a blob and its metadata (not supported in Neo4j)
  35  func (n *N) DeleteBlob(sha256Hash []byte, pubkey []byte) error {
  36  	return errBlobNotSupported
  37  }
  38  
  39  // ListBlobs lists all blobs for a given pubkey (not supported in Neo4j)
  40  func (n *N) ListBlobs(pubkey []byte, since, until int64) ([]*database.BlobDescriptor, error) {
  41  	return nil, errBlobNotSupported
  42  }
  43  
  44  // GetBlobMetadata retrieves only metadata for a blob (not supported in Neo4j)
  45  func (n *N) GetBlobMetadata(sha256Hash []byte) (*database.BlobMetadata, error) {
  46  	return nil, errBlobNotSupported
  47  }
  48  
  49  // GetTotalBlobStorageUsed calculates total storage used by a pubkey in MB (not supported in Neo4j)
  50  func (n *N) GetTotalBlobStorageUsed(pubkey []byte) (totalMB int64, err error) {
  51  	return 0, errBlobNotSupported
  52  }
  53  
  54  // SaveBlobReport stores a report for a blob (not supported in Neo4j)
  55  func (n *N) SaveBlobReport(sha256Hash []byte, reportData []byte) error {
  56  	return errBlobNotSupported
  57  }
  58  
  59  // ListAllBlobUserStats returns storage statistics for all users (not supported in Neo4j)
  60  func (n *N) ListAllBlobUserStats() ([]*database.UserBlobStats, error) {
  61  	return nil, errBlobNotSupported
  62  }
  63  
  64  // ReconcileBlobMetadata is not supported in Neo4j backend
  65  func (n *N) ReconcileBlobMetadata() (int, error) {
  66  	return 0, errBlobNotSupported
  67  }
  68  
  69  // ListAllBlobs returns all blobs (not supported in Neo4j)
  70  func (n *N) ListAllBlobs() ([]*database.BlobDescriptor, error) {
  71  	return nil, errBlobNotSupported
  72  }
  73  
  74  // GetThumbnail retrieves a cached thumbnail (not supported in Neo4j)
  75  func (n *N) GetThumbnail(key string) ([]byte, error) {
  76  	return nil, errBlobNotSupported
  77  }
  78  
  79  // SaveThumbnail caches a thumbnail (not supported in Neo4j)
  80  func (n *N) SaveThumbnail(key string, data []byte) error {
  81  	return errBlobNotSupported
  82  }
  83