Files
services/id/proto/id.proto
2021-06-08 12:34:06 +01:00

31 lines
620 B
Protocol Buffer

syntax = "proto3";
package id;
option go_package = "./proto;id";
service Id {
rpc Generate(GenerateRequest) returns (GenerateResponse) {}
rpc Types(TypesRequest) returns (TypesResponse) {}
}
// Generate a unique ID. Defaults to uuid.
message GenerateRequest {
// type of id e.g uuid, shortid, snowflake (64 bit), bigflake (128 bit)
string type = 1;
}
message GenerateResponse {
// the unique id generated
string id = 1;
// the type of id generated
string type = 2;
}
// List the types of IDs available. No query params needed.
message TypesRequest {}
message TypesResponse {
repeated string types = 1;
}