move protos to specical directory

This commit is contained in:
finlab
2021-01-16 16:08:05 +08:00
committed by huan li
parent c31772fd25
commit 65c0f57363
27 changed files with 3782 additions and 184 deletions

22
protos/echo/v1/echo.proto Normal file
View File

@@ -0,0 +1,22 @@
syntax = "proto3";
package geco.echo.v1;
option go_package = "github.com/user/pkg;pkg";
import "google/protobuf/timestamp.proto";
import "google/api/annotations.proto";
message StringMessage {
string value = 1;
google.protobuf.Timestamp timestamp = 2;
}
service EchoService {
rpc Echo(StringMessage) returns (StringMessage) {
option(google.api.http) = {
post: "/v1/echo/message"
body: "*"
};
}
}

View File

@@ -0,0 +1,96 @@
{
"swagger": "2.0",
"info": {
"title": "echo/v1/echo.proto",
"version": "version not set"
},
"tags": [
{
"name": "EchoService"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/v1/echo/message": {
"post": {
"operationId": "EchoService_Echo",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/v1StringMessage"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/rpcStatus"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/v1StringMessage"
}
}
],
"tags": [
"EchoService"
]
}
}
},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"typeUrl": {
"type": "string"
},
"value": {
"type": "string",
"format": "byte"
}
}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
},
"v1StringMessage": {
"type": "object",
"properties": {
"value": {
"type": "string"
},
"timestamp": {
"type": "string",
"format": "date-time"
}
}
}
}
}