init
This commit is contained in:
14
proto/base.proto
Normal file
14
proto/base.proto
Normal file
@@ -0,0 +1,14 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package main;
|
||||
|
||||
option go_package = ".;main";
|
||||
// The request message containing the user's name.
|
||||
message Request {
|
||||
// NameType nametype = 1;
|
||||
}
|
||||
|
||||
// The response message containing the greetings
|
||||
message Reply {
|
||||
string message = 1;
|
||||
}
|
||||
39
proto/country.proto
Normal file
39
proto/country.proto
Normal file
@@ -0,0 +1,39 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package main;
|
||||
|
||||
option go_package = ".;main";
|
||||
|
||||
|
||||
import "base.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
|
||||
// The greeting service definition.
|
||||
service Country {
|
||||
// Sends a greeting
|
||||
rpc Name (Request) returns (Reply){
|
||||
option (google.api.http) = {
|
||||
post: "/v1/country/name"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
rpc Picture (Request) returns (CountryReply){
|
||||
option (google.api.http) = {
|
||||
post: "/v1/country/name/picture"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// The response message containing the greetings
|
||||
message CountryReply {
|
||||
bytes image = 1;
|
||||
}
|
||||
|
||||
// enum NameType {
|
||||
// FullName = 0;
|
||||
// FirstName = 1;
|
||||
// LastName = 2 ;
|
||||
// }
|
||||
@@ -5,25 +5,26 @@ package main;
|
||||
option go_package = ".;main";
|
||||
|
||||
import "google/api/annotations.proto";
|
||||
import "base.proto";
|
||||
|
||||
// The greeting service definition.
|
||||
service Name {
|
||||
// Sends a greeting
|
||||
rpc FirstName (NameRequest) returns (NameReply){
|
||||
rpc FirstName (Request) returns (Reply){
|
||||
option (google.api.http) = {
|
||||
post: "/v1/name/firstname"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
rpc LastName (NameRequest) returns (NameReply){
|
||||
rpc LastName (Request) returns (Reply){
|
||||
option (google.api.http) = {
|
||||
post: "/v1/name/lastname"
|
||||
body: "*"
|
||||
};
|
||||
}
|
||||
|
||||
rpc FullName (NameRequest) returns (NameReply){
|
||||
rpc FullName (Request) returns (Reply){
|
||||
option (google.api.http) = {
|
||||
post: "/v1/name/fullname"
|
||||
body: "*"
|
||||
@@ -31,16 +32,6 @@ service Name {
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user