Skip to content

Commit

Permalink
chore: split out into another service
Browse files Browse the repository at this point in the history
Signed-off-by: AlexsJones <[email protected]>
  • Loading branch information
AlexsJones committed Sep 20, 2024
1 parent e1fa52d commit 6c4c41c
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
BUF_VERSION=v1.28.0
TAG=protobuf-v0.2.2
TAG=protobuf-v0.2.3
guard-%:
@ if [ "${${*}}" = "" ]; then \
echo "Environment variable $* not set"; \
Expand Down
10 changes: 0 additions & 10 deletions protobuf/schema/v1/server_analyzer_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,6 @@ message QueryResponse {

service ServerAnalyzerService {

rpc Query(QueryRequest) returns (QueryResponse) {
option (google.api.http) = {
// this is url, for RESTfull/JSON api and method
// this line means when a HTTP post request comes with "/v1/query" call this rpc method over this service
// the request body QueryRequest can be passed in to parameterize the request
post: "/v1/query"
body: "*"
};
}

rpc Analyze(AnalyzeRequest) returns (AnalyzeResponse) {
// option type is http
option (google.api.http) = {
Expand Down
38 changes: 38 additions & 0 deletions protobuf/schema/v1/server_query_service.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
syntax = "proto3";

package schema.v1;

// well know type by google, gRPC gateway uses HTTP annotation.
import "google/api/annotations.proto";

option go_package = "schema/service/v1";


message Error {
string message = 1;
int32 code = 2;
}

message QueryRequest {
string backend = 1;
string query = 2;
}

message QueryResponse {
Error error = 1;
string response = 2;
}


service ServerAnalyzerService {

rpc Query(QueryRequest) returns (QueryResponse) {
option (google.api.http) = {
// this is url, for RESTfull/JSON api and method
// this line means when a HTTP post request comes with "/v1/query" call this rpc method over this service
// the request body QueryRequest can be passed in to parameterize the request
post: "/v1/query"
body: "*"
};
}
};

0 comments on commit 6c4c41c

Please sign in to comment.