154 lines
2.8 KiB
Protocol Buffer
154 lines
2.8 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = "./proto";
|
|
package raft;
|
|
|
|
service RaftAdmin {
|
|
rpc AddNonvoter(AddNonvoterRequest) returns (Future) {}
|
|
rpc AddVoter(AddVoterRequest) returns (Future) {}
|
|
rpc AppliedIndex(AppliedIndexRequest) returns (AppliedIndexResponse) {}
|
|
rpc ApplyLog(ApplyLogRequest) returns (Future) {}
|
|
rpc Barrier(BarrierRequest) returns (Future) {}
|
|
rpc DemoteVoter(DemoteVoterRequest) returns (Future) {}
|
|
rpc GetConfiguration(GetConfigurationRequest) returns (GetConfigurationResponse) {}
|
|
rpc LastContact(LastContactRequest) returns (LastContactResponse) {}
|
|
rpc LastIndex(LastIndexRequest) returns (LastIndexResponse) {}
|
|
rpc Leader(LeaderRequest) returns (LeaderResponse) {}
|
|
rpc LeadershipTransfer(LeadershipTransferRequest) returns (Future) {}
|
|
rpc LeadershipTransferToServer(LeadershipTransferToServerRequest) returns (Future) {}
|
|
rpc RemoveServer(RemoveServerRequest) returns (Future) {}
|
|
rpc Shutdown(ShutdownRequest) returns (Future) {}
|
|
rpc Snapshot(SnapshotRequest) returns (Future) {}
|
|
rpc State(StateRequest) returns (StateResponse) {}
|
|
rpc Stats(StatsRequest) returns (StatsResponse) {}
|
|
rpc VerifyLeader(VerifyLeaderRequest) returns (Future) {}
|
|
|
|
rpc Await(Future) returns (AwaitResponse) {}
|
|
rpc Forget(Future) returns (ForgetResponse) {}
|
|
}
|
|
|
|
message Future {
|
|
string operation_token = 1;
|
|
}
|
|
|
|
message AwaitResponse {
|
|
string error = 1;
|
|
uint64 index = 2;
|
|
}
|
|
|
|
message ForgetResponse {
|
|
}
|
|
|
|
message AddVoterRequest {
|
|
string id = 1;
|
|
string address = 2;
|
|
uint64 previous_index = 3;
|
|
}
|
|
|
|
message AddNonvoterRequest {
|
|
string id = 1;
|
|
string address = 2;
|
|
uint64 previous_index = 3;
|
|
}
|
|
|
|
message ApplyLogRequest {
|
|
bytes data = 1;
|
|
bytes extensions = 2;
|
|
}
|
|
|
|
message AppliedIndexRequest {
|
|
}
|
|
|
|
message AppliedIndexResponse {
|
|
uint64 index = 1;
|
|
}
|
|
|
|
message BarrierRequest {
|
|
}
|
|
|
|
message DemoteVoterRequest {
|
|
string id = 1;
|
|
uint64 previous_index = 2;
|
|
}
|
|
|
|
message GetConfigurationRequest {
|
|
}
|
|
|
|
message GetConfigurationResponse {
|
|
message Server {
|
|
enum Suffrage {
|
|
VOTER = 0;
|
|
NONVOTER = 1;
|
|
STAGING = 2;
|
|
}
|
|
Suffrage suffrage = 1;
|
|
string id = 2;
|
|
string address = 3;
|
|
}
|
|
|
|
repeated Server servers = 1;
|
|
}
|
|
|
|
|
|
message LastContactRequest {
|
|
}
|
|
|
|
message LastContactResponse {
|
|
int64 unix_nano = 1;
|
|
}
|
|
|
|
message LastIndexRequest {
|
|
}
|
|
|
|
message LastIndexResponse {
|
|
uint64 index = 1;
|
|
}
|
|
|
|
message LeaderRequest {
|
|
}
|
|
|
|
message LeaderResponse {
|
|
string address = 1;
|
|
}
|
|
|
|
message LeadershipTransferRequest {
|
|
}
|
|
|
|
message LeadershipTransferToServerRequest {
|
|
string id = 1;
|
|
string address = 2;
|
|
}
|
|
|
|
message RemoveServerRequest {
|
|
string id = 1;
|
|
uint64 previous_index = 2;
|
|
}
|
|
|
|
message ShutdownRequest {
|
|
}
|
|
|
|
message SnapshotRequest {
|
|
}
|
|
|
|
message StateRequest {
|
|
}
|
|
|
|
message StateResponse {
|
|
enum State {
|
|
FOLLOWER = 0;
|
|
CANDIDATE = 1;
|
|
LEADER = 2;
|
|
SHUTDOWN = 3;
|
|
}
|
|
State state = 1;
|
|
}
|
|
|
|
message StatsRequest {
|
|
}
|
|
|
|
message StatsResponse {
|
|
map<string, string> stats = 1;
|
|
}
|
|
|
|
message VerifyLeaderRequest {
|
|
} |