Last active
February 29, 2020 11:29
-
-
Save Vivek205/388e41c7f967a7b4dd847c490789a31b to your computer and use it in GitHub Desktop.
Sample Proto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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