48 lines
892 B
Protocol Buffer
48 lines
892 B
Protocol Buffer
syntax = "proto3";
|
|
|
|
package main;
|
|
|
|
option go_package = ".;main";
|
|
|
|
import "google/api/annotations.proto";
|
|
|
|
// The greeting service definition.
|
|
service Name {
|
|
// Sends a greeting
|
|
rpc FirstName (NameRequest) returns (NameReply){
|
|
option (google.api.http) = {
|
|
post: "/v1/name/firstname"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc LastName (NameRequest) returns (NameReply){
|
|
option (google.api.http) = {
|
|
post: "/v1/name/lastname"
|
|
body: "*"
|
|
};
|
|
}
|
|
|
|
rpc FullName (NameRequest) returns (NameReply){
|
|
option (google.api.http) = {
|
|
post: "/v1/name/fullname"
|
|
body: "*"
|
|
};
|
|
}
|
|
}
|
|
|
|
// The request message containing the user's name.
|
|
message NameRequest {
|
|
// NameType nametype = 1;
|
|
}
|
|
|
|
// The response message containing the greetings
|
|
message NameReply {
|
|
string message = 1;
|
|
}
|
|
|
|
// enum NameType {
|
|
// FullName = 0;
|
|
// FirstName = 1;
|
|
// LastName = 2 ;
|
|
// } |