-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathplugin.proto
86 lines (79 loc) · 1.85 KB
/
plugin.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
syntax = "proto3";
package example.regexp;
import "grpc/federation/federation.proto";
option go_package = "example/plugin;pluginpb";
message Regexp {
uint32 ptr = 1; // store raw pointer value.
}
message Example {
}
option (grpc.federation.file).plugin.export = {
name: "regexp"
types: [
{
name: "Regexp"
desc: "Regexp is the representation of a compiled regular expression"
methods: [
{
name: "matchString"
desc: "matchString reports whether the string s contains any match of the regular expression"
args {
name: "s"
type { kind: STRING }
desc: "target text"
}
return { kind: BOOL }
}
]
},
{
name: "Example"
desc: "example type"
methods: [
{
name: "concat"
args { type { repeated {kind: STRING} } }
return { kind: STRING }
},
{
name: "mySplit"
args { name: "s" type {kind: STRING} }
args { name: "sep" type {kind: STRING} }
return { repeated {kind: STRING} }
}
]
}
]
functions: [
{
name: "compile"
desc: "compile parses a regular expression and returns, if successful, a Regexp that can be used to match against text"
args {
name: "expr"
type { kind: STRING }
desc: "a regular expression text"
}
return { message: "Regexp" }
},
{
name: "newExample"
return { message: "Example" }
},
{
name: "newExamples"
return { repeated {message: "Example"} }
},
{
name: "filterExamples"
args {type {repeated {message: "Example"}}}
return { repeated {message: "Example"} }
}
]
variables: [
{
name: "val"
desc: "a variable for test"
type { kind: STRING }
}
]
};