diff --git a/protobuf/buf.lock b/protobuf/buf.lock new file mode 100644 index 0000000..ac0a444 --- /dev/null +++ b/protobuf/buf.lock @@ -0,0 +1,13 @@ +# Generated by buf. DO NOT EDIT. +version: v1 +deps: + - remote: buf.build + owner: googleapis + repository: googleapis + commit: 7e6f6e774e29406da95bd61cdcdbc8bc + digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 + - remote: buf.build + owner: grpc-ecosystem + repository: grpc-gateway + commit: 3f42134f4c564983838425bc43c7a65f + digest: shake256:3d11d4c0fe5e05fda0131afefbce233940e27f0c31c5d4e385686aea58ccd30f72053f61af432fa83f1fc11cda57f5f18ca3da26a29064f73c5a0d076bba8d92 diff --git a/protobuf/schema/v1/analyzer.proto b/protobuf/schema/v1/analyzer.proto index bdc6c85..8f9bd11 100644 --- a/protobuf/schema/v1/analyzer.proto +++ b/protobuf/schema/v1/analyzer.proto @@ -2,7 +2,7 @@ syntax = "proto3"; package schema.v1; -import "server-service.proto"; +import "schema/v1/server-service.proto"; option go_package = "schema/service/v1"; diff --git a/protobuf/schema/v1/server-service.proto b/protobuf/schema/v1/server-service.proto index 048e65c..28e31cd 100644 --- a/protobuf/schema/v1/server-service.proto +++ b/protobuf/schema/v1/server-service.proto @@ -4,6 +4,9 @@ package schema.v1; option go_package = "schema/service/v1"; +// well know type by google, gRPC gateway uses HTTP annotation. +import "google/api/annotations.proto"; + message AnalyzeRequest { string backend = 1; string namespace = 2; @@ -116,8 +119,21 @@ message ListIntegrationsResponse { } service ServerService { - rpc Analyze(AnalyzeRequest) returns (AnalyzeResponse) {} + rpc Analyze(AnalyzeRequest) returns (AnalyzeResponse) { + // option type is http + option (google.api.http) = { + // this is url, for RESTfull/JSON api and method + // this line means when a HTTP post request comes with "/v1/analyze" call this rpc method over this service + post: "/v1/analyze" + }; + } rpc AddConfig(AddConfigRequest) returns (AddConfigResponse) {} rpc RemoveConfig(RemoveConfigRequest) returns (RemoveConfigResponse) {} - rpc ListIntegrations(ListIntegrationsRequest) returns (ListIntegrationsResponse) {} + rpc ListIntegrations(ListIntegrationsRequest) returns (ListIntegrationsResponse) { + // option type is http + option (google.api.http) = { + // this line means when a HTTP GET request comes with "/v1/list" call this rpc method over this service + get: "/v1/list" + }; + } }