Gabriel Simmer
8a65ef8cb4
Some checks failed
Fly Deploy / Deploy app (push) Failing after 3m6s
Disabled unless peers are provided, communicates with other instances (up to 3, and then a random selection of a third of the available hosts). Still to do: - [ ] DNS based peer discovery - [ ] Probing of instances / healthchecks - [ ] Test propogation of membership changes/additions
52 lines
703 B
Protocol Buffer
52 lines
703 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package gabrielsimmerdotcom.gossip;
|
|
|
|
message Ping {}
|
|
|
|
message PingRequest {
|
|
string peer = 1;
|
|
}
|
|
|
|
enum Status {
|
|
PEER_UNKNOWN = 0;
|
|
PEER_ALIVE = 1;
|
|
PEER_SUSPECT = 2;
|
|
PEER_CONFIRM = 3;
|
|
}
|
|
|
|
// { "127.0.0.1:1337", confirm }
|
|
message Membership {
|
|
string peer = 1;
|
|
Status status = 2;
|
|
int64 inc = 3;
|
|
}
|
|
|
|
message NewCache {
|
|
string key = 1;
|
|
string content = 2;
|
|
string content_type = 3;
|
|
}
|
|
|
|
message Cache {
|
|
string key = 1;
|
|
string content = 2;
|
|
string content_type = 3;
|
|
int64 timestamp = 4;
|
|
}
|
|
|
|
message Payload {
|
|
string peer = 1;
|
|
oneof msg {
|
|
Cache cache = 2;
|
|
Ping ping = 3;
|
|
Ack ack = 4;
|
|
Membership membership = 5;
|
|
NewCache new_cache = 6;
|
|
}
|
|
}
|
|
|
|
message Ack {
|
|
|
|
}
|