feat(caddystorage): simplify CaddyStorage gRPC API to allow only one2one calls

This commit is contained in:
Pasha Sviderski committed 2026-09-08 14:36:43 +10:00
1 parent 842f796e38
commit 992b819f5b
6 files changed
+304 -563

No files matched your search

+11 -27
View File
@@ -6,14 +6,16 @@ option go_package = "github.com/psviderski/uncloud/api/pb";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "api/pb/common.proto";
// CaddyStorage exposes the CertMagic storage operations backed by the distributed cluster store.
// Each request operates on the receiving machine's store replica. Callers that need replication to catch up before
// reading should capture store versions with Machine.InspectMachine and call Machine.WaitForStoreVersion on the
// receiving machine, subject to that RPC's data-availability limitations (see WaitForStoreVersion docs).
// See Storage interface in https://github.com/caddyserver/certmagic/blob/master/storage.go.
service CaddyStorage {
rpc Store(StoreCaddyStorageRequest) returns (google.protobuf.Empty);
rpc Load(LoadCaddyStorageRequest) returns (LoadCaddyStorageResponse);
rpc Delete(DeleteCaddyStorageRequest) returns (EmptyResponse);
rpc Delete(DeleteCaddyStorageRequest) returns (google.protobuf.Empty);
rpc List(ListCaddyStorageRequest) returns (ListCaddyStorageResponse);
rpc Stat(StatCaddyStorageRequest) returns (StatCaddyStorageResponse);
}
@@ -28,14 +30,8 @@ message LoadCaddyStorageRequest {
}
message LoadCaddyStorageResponse {
// Must contain only one repeated messages field to allow broadcasting Load requests to multiple machines.
repeated MachineCaddyStorageValue messages = 1;
}
message MachineCaddyStorageValue {
Metadata metadata = 1;
bytes value = 2;
google.protobuf.Timestamp updated_at = 3;
bytes value = 1;
google.protobuf.Timestamp updated_at = 2;
}
message DeleteCaddyStorageRequest {
@@ -48,13 +44,7 @@ message ListCaddyStorageRequest {
}
message ListCaddyStorageResponse {
// Must contain only one repeated messages field to allow broadcasting List requests to multiple machines.
repeated MachineCaddyStorageKeys messages = 1;
}
message MachineCaddyStorageKeys {
Metadata metadata = 1;
repeated string keys = 2;
repeated string keys = 1;
}
message StatCaddyStorageRequest {
@@ -62,14 +52,8 @@ message StatCaddyStorageRequest {
}
message StatCaddyStorageResponse {
// Must contain only one repeated messages field to allow broadcasting Stat requests to multiple machines.
repeated MachineCaddyStorageKeyInfo messages = 1;
}
message MachineCaddyStorageKeyInfo {
Metadata metadata = 1;
string key = 2;
google.protobuf.Timestamp updated_at = 3;
int64 size = 4;
bool is_terminal = 5;
string key = 1;
google.protobuf.Timestamp updated_at = 2;
int64 size = 3;
bool is_terminal = 4;
}