Files
drive/apps/backend/internal/virtualfs/key_resolver.go

23 lines
644 B
Go
Raw Normal View History

2025-11-27 20:49:58 +00:00
package virtualfs
import (
"context"
"github.com/get-drexa/drexa/internal/blob"
2025-12-02 22:08:50 +00:00
"github.com/uptrace/bun"
2025-11-27 20:49:58 +00:00
)
type BlobKeyResolver interface {
// ShouldPersistKey returns true if the resolved key should be stored in node.BlobKey.
// Flat keys (e.g. UUIDs) return true - key is generated once and stored.
// Hierarchical keys return false - key is derived from path each time.
ShouldPersistKey() bool
2025-12-02 22:08:50 +00:00
Resolve(ctx context.Context, db bun.IDB, node *Node) (blob.Key, error)
2025-11-30 01:16:44 +00:00
ResolveDeletionKeys(ctx context.Context, node *Node, allKeys []blob.Key) (*DeletionPlan, error)
2025-11-27 20:49:58 +00:00
}
2025-11-30 01:16:44 +00:00
type DeletionPlan struct {
Prefix blob.Key
Keys []blob.Key
2025-11-27 20:49:58 +00:00
}