Created
February 6, 2018 07:52
-
-
Save agreatfool/5e3a41052c6dd2f6d04b30901fc0269b to your computer and use it in GitHub Desktop.
Sample proto file
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