Skip to content

Instantly share code, notes, and snippets.

@Vivek205
Last active February 29, 2020 11:29
Show Gist options
  • Save Vivek205/388e41c7f967a7b4dd847c490789a31b to your computer and use it in GitHub Desktop.
Save Vivek205/388e41c7f967a7b4dd847c490789a31b to your computer and use it in GitHub Desktop.
Sample Proto
syntax = "proto3";
package com.book;
message Book {
int64 isbn = 1;
string title = 2;
string author = 3;
}
message GetBookRequest {
int64 isbn = 1;
}
message GetBookViaAuthor {
string author = 1;
}
service BookService {
rpc GetBook (GetBookRequest) returns (Book) {}
rpc GetBooksViaAuthor (GetBookViaAuthor) returns (stream Book) {}
rpc GetGreatestBook (stream GetBookRequest) returns (Book) {}
rpc GetBooks (stream GetBookRequest) returns (stream Book) {}
}
message BookStore {
string name = 1;
map<int64, string> books = 2;
}
enum EnumSample {
option allow_alias = true;
UNKNOWN = 0;
STARTED = 1;
RUNNING = 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment