Skip to content

Instantly share code, notes, and snippets.

@wfng92
Created September 8, 2022 08:14
Show Gist options
  • Save wfng92/75707f8ef0c101df4c4eff3ce47deb3b to your computer and use it in GitHub Desktop.
Save wfng92/75707f8ef0c101df4c4eff3ce47deb3b to your computer and use it in GitHub Desktop.
syntax = "proto3";
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (StringResponse) {}
// Uploads a file
rpc UploadFile(stream UploadFileRequest) returns (StringResponse) {}
// Downloads a file
rpc DownloadFile(MetaData) returns (stream FileResponse) {}
}
message HelloRequest {
string name = 1;
int32 age = 2;
}
message StringResponse {
string message = 1;
}
message FileResponse {
bytes chunk_data = 1;
}
message MetaData {
string filename = 1;
string extension = 2;
}
message UploadFileRequest {
oneof request {
MetaData metadata = 1;
bytes chunk_data = 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment