Skip to content

Instantly share code, notes, and snippets.

@hadv
Created April 20, 2017 01:08
Show Gist options
  • Save hadv/c0ea7becd7652402e323628503341982 to your computer and use it in GitHub Desktop.
Save hadv/c0ea7becd7652402e323628503341982 to your computer and use it in GitHub Desktop.
syntax = “proto3”;
option go_package = “echo”;
// Echo Service
//
// Echo Service API consists of a single service which returns a message.
package hadv.grpc.echo;
import “google/api/annotations.proto”;
// Message represents a simple message sent to the Echo service.
message Message {
// Id represents the message identifier.
string id = 1;
}
// Echo service responds to incoming echo requests.
service EchoService {
// Echo method receives a simple message and returns it.
// The message posted as the id parameter will also be returned.
rpc Echo(Message) returns (Message) {
option (google.api.http) = {
post: “/v1/example/echo/{id}”
};
}
// EchoBody method receives a simple message and returns it.
rpc EchoBody(Message) returns (Message) {
option (google.api.http) = {
post: “/v1/example/echo_body”
body: “*”
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment