mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 20:52:22 +00:00
24 lines
378 B
Protocol Buffer
24 lines
378 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package main;
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
message StringMessage {
|
|
string value = 1;
|
|
}
|
|
|
|
service RestService {
|
|
rpc Get(StringMessage) returns (StringMessage) {
|
|
option (google.api.http) = {
|
|
get: "/get/{value}"
|
|
};
|
|
}
|
|
rpc Post(StringMessage) returns (StringMessage) {
|
|
option (google.api.http) = {
|
|
post: "/post"
|
|
body: "*"
|
|
};
|
|
}
|
|
}
|