Documentation
¶
Index ¶
- func CountExcludedInSubtree(database *db.DB, queueType string, rootPath string) (int, error)
- func CountExcludedNodes(database *db.DB, queueType string) (int, error)
- func CountPendingNodes(database *db.DB, queueType string) (int, error)
- func CountSubtree(database *db.DB, queueType string, rootPath string) (db.SubtreeStats, error)
- func DeleteSubtree(database *db.DB, queueType string, rootPath string) error
- func GetTopLevelChildren(database *db.DB, queueType string, rootPath string) ([]*db.NodeState, error)
- func LoadSpectraRoots(spectraFS *sdk.SpectraFS) (types.Folder, types.Folder, error)
- func MarkNodeAsExcluded(database *db.DB, queueType string, nodePath string) error
- func MarkNodeAsFailed(database *db.DB, queueType string, nodePath string) error
- func MarkNodeAsPending(database *db.DB, queueType string, nodePath string) error
- func MarkNodeAsUnexcluded(database *db.DB, queueType string, nodePath string) error
- func PickFirstExcludedTopLevelChild(database *db.DB, queueType string, rootPath string) (*db.NodeState, error)
- func PickRandomExcludedTopLevelChild(database *db.DB, queueType string, rootPath string) (*db.NodeState, error)
- func PickRandomTopLevelChild(database *db.DB, queueType string, rootPath string) (*db.NodeState, error)
- func PrintVerification(result migration.Result)
- func SetupEphemeralTest(removeMigrationDB bool) (migration.Config, error)
- func SetupLocalTest(srcPath, dstPath string, removeMigrationDB bool) (migration.Config, error)
- func SetupSpectraFS(configPath string, cleanDB bool) (*sdk.SpectraFS, error)
- func SetupTest(cleanSpectraDB bool, removeMigrationDB bool) (migration.Config, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountExcludedInSubtree ¶
CountExcludedInSubtree counts excluded nodes within the subtree at rootPath (single SQL query).
func CountExcludedNodes ¶
CountExcludedNodes counts all excluded nodes in the table (excluded = true).
func CountPendingNodes ¶
CountPendingNodes counts all pending nodes across all levels for a queue type (from stats table).
func CountSubtree ¶
CountSubtree returns aggregate counts for the subtree at rootPath using a single SQL query (path prefix). Uses db.CountSubtree.
func DeleteSubtree ¶
DeleteSubtree deletes all nodes in the subtree at rootPath and recomputes stats for affected depths. Uses Writer.DeleteSubtree.
func GetTopLevelChildren ¶
func GetTopLevelChildren(database *db.DB, queueType string, rootPath string) ([]*db.NodeState, error)
GetTopLevelChildren returns direct children of the node at rootPath (by parent_path = rootPath).
func LoadSpectraRoots ¶
LoadSpectraRoots fetches the Spectra root nodes and maps them to types.Folder structures.
func MarkNodeAsExcluded ¶
MarkNodeAsExcluded marks a node as excluded in the database (direct live-table update).
func MarkNodeAsFailed ¶
MarkNodeAsFailed marks a node as failed in the database (direct live-table update + stats recompute).
func MarkNodeAsPending ¶
MarkNodeAsPending marks a node as pending in the database (direct live-table update + stats recompute).
func MarkNodeAsUnexcluded ¶
MarkNodeAsUnexcluded marks a node as not excluded in the database (direct live-table update).
func PickFirstExcludedTopLevelChild ¶
func PickFirstExcludedTopLevelChild(database *db.DB, queueType string, rootPath string) (*db.NodeState, error)
PickFirstExcludedTopLevelChild picks the first top-level child that is currently excluded. Only selects folders (not files) that are excluded. Useful for deterministic tests.
func PickRandomExcludedTopLevelChild ¶
func PickRandomExcludedTopLevelChild(database *db.DB, queueType string, rootPath string) (*db.NodeState, error)
PickRandomExcludedTopLevelChild picks a random top-level child that is currently excluded. Only selects folders (not files) that are excluded.
func PickRandomTopLevelChild ¶
func PickRandomTopLevelChild(database *db.DB, queueType string, rootPath string) (*db.NodeState, error)
PickRandomTopLevelChild picks a random top-level child from the root. Only selects folders (not files).
func PrintVerification ¶
PrintVerification prints the verification results in a formatted way.
func SetupEphemeralTest ¶
SetupEphemeralTest assembles the Spectra-backed migration configuration using ephemeral mode. Ephemeral mode doesn't persist data to a database, so no Spectra DB cleanup is needed. removeMigrationDB controls whether to remove the migration database (use false for resumption tests).
func SetupLocalTest ¶
SetupLocalTest assembles a local filesystem-backed migration configuration. srcPath and dstPath are absolute paths to the source and destination directories. removeMigrationDB controls whether to remove the migration database (use false for resumption tests).
func SetupSpectraFS ¶
SetupSpectraFS creates a SpectraFS instance, handling DB cleanup appropriately. Since each test run is a separate process, we can't rely on in-memory state. Instead, we check if the DB file exists (from the config) and only clean it if explicitly requested. The SDK should load existing data from the DB file if it exists. The configPath should point to a JSON config file that contains the db_path.
Types ¶
This section is empty.