-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: split out into another service
Signed-off-by: AlexsJones <[email protected]>
- Loading branch information
1 parent
e1fa52d
commit 6c4c41c
Showing
3 changed files
with
39 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: "*" | ||
}; | ||
} | ||
}; |