Skip to content

Commit 6508c71

Browse files
committed
Move constants to a separate file
1 parent 8c38532 commit 6508c71

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

plugin/plugin.go

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -20,36 +20,10 @@ import (
2020
"google.golang.org/grpc"
2121
)
2222

23-
const (
24-
DecodedQueryField string = "decodedQuery"
25-
DetectorField string = "detector"
26-
ScoreField string = "score"
27-
QueryField string = "query"
28-
ErrorField string = "error"
29-
IsInjectionField string = "is_injection"
30-
ResponseField string = "response"
31-
OutputsField string = "outputs"
32-
TokensField string = "tokens"
33-
StringField string = "String"
34-
ResponseTypeField string = "response_type"
35-
36-
DeepLearningModel string = "deep_learning_model"
37-
Libinjection string = "libinjection"
38-
39-
ResponseType string = "error"
40-
ErrorSeverity string = "EXCEPTION"
41-
ErrorNumber string = "42000"
42-
ErrorMessage string = "SQL injection detected"
43-
ErrorDetail string = "Back off, you're not welcome here."
44-
LogLevel string = "error"
45-
46-
TokenizeAndSequencePath string = "/tokenize_and_sequence"
47-
PredictPath string = "/v1/models/%s/versions/%s:predict"
48-
)
49-
5023
type Plugin struct {
5124
goplugin.GRPCPlugin
5225
v1.GatewayDPluginServiceServer
26+
5327
Logger hclog.Logger
5428
Threshold float32
5529
EnableLibinjection bool
@@ -68,6 +42,7 @@ type Plugin struct {
6842

6943
type InjectionDetectionPlugin struct {
7044
goplugin.NetRPCUnsupportedPlugin
45+
7146
Impl Plugin
7247
}
7348

0 commit comments

Comments
 (0)