Add logging, fix devenv up

This commit is contained in:
Alexander
2026-06-30 12:17:48 +02:00
parent ebf1c5b5e1
commit d1e1ac97c4
32 changed files with 1549 additions and 129 deletions
+3
View File
@@ -4,6 +4,9 @@ modules:
lint:
use:
- STANDARD
except:
- RPC_RESPONSE_STANDARD_NAME
- RPC_REQUEST_RESPONSE_UNIQUE
breaking:
use:
- FILE
+36 -8
View File
@@ -3,17 +3,27 @@ syntax = "proto3";
package musicfs;
// MusicFs service exposes a server-side music library to a remote musicfs
// FUSE mount. Three RPCs, all server-streaming so the client can pull
// incrementally and the server can keep large bodies off the heap.
// FUSE mount.
service MusicFs {
// Stream every file entry in the library. The client diffs each entry's
// hash against its DB to decide what changed.
// Hash-based reconciliation. Client sends the (inode, hash) pairs it
// currently has; server responds with the subset that changed (new or
// hash-different) plus the inodes the client has but the server no longer
// has. Cheap on the wire — no file metadata crosses until the client asks.
rpc Reconcile(ReconcileRequest) returns (ReconcileResponse);
// Fetch full metadata for a specific set of inodes. Called after Reconcile
// returns a non-empty `changed` list, for just those inodes.
rpc GetMetadata(GetMetadataRequest) returns (stream ManifestEntry);
// Stream every file entry in the library. Convenience RPC for first-run
// bootstrapping or full-refresh. The diff-based Reconcile path is the
// normal case.
rpc GetManifest(GetManifestRequest) returns (stream ManifestEntry);
// Stream the bytes of one file. If `start` and `length` are both set on
// the request, only that byte range is sent; otherwise the whole file.
// The first chunk carries `total_size` and `offset`; subsequent chunks
// continue from there.
// Stream the bytes of one file. If `start` and `length` are both zero the
// server streams the entire file; otherwise just the requested range. The
// first chunk carries `total_size` and `offset`; subsequent chunks continue
// from there.
rpc GetFile(GetFileRequest) returns (stream FileChunk);
// Long-lived stream of filesystem change events. The client uses these as
@@ -22,6 +32,24 @@ service MusicFs {
rpc SubscribeEvents(SubscribeEventsRequest) returns (stream ChangeEvent);
}
message ReconcileRequest {
repeated InodeHash entries = 1;
}
message ReconcileResponse {
repeated InodeHash changed = 1;
repeated uint64 deleted = 2;
}
message InodeHash {
uint64 inode = 1;
uint64 hash = 2;
}
message GetMetadataRequest {
repeated uint64 inodes = 1;
}
message GetManifestRequest {}
message GetFileRequest {