Steps 12 & 12b: gRPC server and directory recursion + mirror.
Step 12: GardenSync gRPC server with 5 RPC handlers — PushManifest (timestamp comparison, missing blob detection), PushBlobs (chunked streaming, manifest replacement), PullManifest, PullBlobs, Prune. Added store.List() and garden.ListBlobs()/DeleteBlob() for prune. In-process tests via bufconn. Step 12b: Add now recurses directories (walks files/symlinks, skips dir entries). Mirror up syncs filesystem → manifest (add new, remove deleted, rehash changed). Mirror down syncs manifest → filesystem (restore + delete untracked with optional confirm). 7 tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,6 +127,16 @@ func (g *Garden) ReplaceManifest(m *manifest.Manifest) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// ListBlobs returns all blob hashes in the store.
|
||||
func (g *Garden) ListBlobs() ([]string, error) {
|
||||
return g.store.List()
|
||||
}
|
||||
|
||||
// DeleteBlob removes a blob from the store by hash.
|
||||
func (g *Garden) DeleteBlob(hash string) error {
|
||||
return g.store.Delete(hash)
|
||||
}
|
||||
|
||||
// addEntry adds a single file or symlink to the manifest. The abs path must
|
||||
// already be resolved and info must come from os.Lstat. If skipDup is true,
|
||||
// already-tracked paths are silently skipped instead of returning an error.
|
||||
|
||||
Reference in New Issue
Block a user