-
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.
Signed-off-by: AlexsJones <[email protected]>
- Loading branch information
1 parent
f2ddb11
commit 744d6bb
Showing
4 changed files
with
109 additions
and
72 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
syntax = "proto3"; | ||
|
||
package schema.v1; | ||
// well know type by google, gRPC gateway uses HTTP annotation. | ||
import "google/api/annotations.proto"; | ||
|
||
import "schema/v1/server_analyzer_service.proto"; | ||
|
||
option go_package = "schema/service/v1"; | ||
|
||
message RunRequest {} | ||
|
||
message RunResponse { | ||
schema.v1.Result result = 1; | ||
} | ||
|
||
service CustomAnalyzerService { | ||
|
||
rpc Run (RunRequest) returns (RunResponse) { | ||
option (google.api.http) = { | ||
post: "/v1/run" | ||
body: "*" | ||
}; | ||
} | ||
} |
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,66 @@ | ||
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 AnalyzeRequest { | ||
string backend = 1; | ||
string namespace = 2; | ||
bool explain = 3; | ||
bool anonymize = 4; | ||
bool nocache = 5; | ||
string language = 6; | ||
int32 max_concurrency = 7; | ||
string output = 8; | ||
repeated string filters = 9; | ||
string label_selector = 10; | ||
} | ||
|
||
message SensitiveData { | ||
string unmasked = 1; | ||
string masked = 2; | ||
} | ||
|
||
message ErrorDetail { | ||
string text = 1; | ||
repeated SensitiveData sensitive = 2; | ||
} | ||
|
||
message Result { | ||
string kind = 1; | ||
string name = 2; | ||
repeated ErrorDetail error = 3; | ||
string details = 4; | ||
string parent_object = 5; | ||
} | ||
|
||
message AnalyzeResponse { | ||
Error error = 1; | ||
repeated string errors = 2; | ||
string status = 3; | ||
int32 problems = 4; | ||
repeated Result results = 5; | ||
} | ||
|
||
message Error { | ||
string message = 1; | ||
int32 code = 2; | ||
} | ||
|
||
|
||
service ServerAnalyzerService { | ||
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 | ||
// the request body AnalyzeRequest can be passed in to parameterize the request | ||
post: "/v1/analyze" | ||
body: "*" | ||
}; | ||
} | ||
}; |
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