Skip to content

Commit 6b758b6

Browse files
committed
add param into webhook
1 parent 14749fc commit 6b758b6

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

pkg/mock/types.go

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,62 +16,63 @@ limitations under the License.
1616
package mock
1717

1818
type Object struct {
19-
Name string `yaml:"name" json:"name"`
20-
InitCount *int `yaml:"initCount" json:"initCount"`
21-
Sample string `yaml:"sample" json:"sample"`
19+
Name string `yaml:"name" json:"name"`
20+
InitCount *int `yaml:"initCount" json:"initCount"`
21+
Sample string `yaml:"sample" json:"sample"`
2222
}
2323

2424
type Item struct {
25-
Name string `yaml:"name" json:"name"`
26-
Request Request `yaml:"request" json:"request"`
27-
Response Response `yaml:"response" json:"response"`
28-
Param map[string]string
25+
Name string `yaml:"name" json:"name"`
26+
Request Request `yaml:"request" json:"request"`
27+
Response Response `yaml:"response" json:"response"`
28+
Param map[string]string
2929
}
3030

3131
type Request struct {
32-
Path string `yaml:"path" json:"path"`
33-
Method string `yaml:"method" json:"method"`
34-
Header map[string]string `yaml:"header" json:"header"`
35-
Body string `yaml:"body" json:"body"`
32+
Path string `yaml:"path" json:"path"`
33+
Method string `yaml:"method" json:"method"`
34+
Header map[string]string `yaml:"header" json:"header"`
35+
Body string `yaml:"body" json:"body"`
3636
}
3737

3838
type RequestWithAuth struct {
39-
Request `yaml:",inline"`
40-
BearerAPI string `yaml:"bearerAPI" json:"bearerAPI"`
41-
Username string `yaml:"username" json:"username"`
42-
Password string `yaml:"password" json:"password"`
39+
Request `yaml:",inline"`
40+
BearerAPI string `yaml:"bearerAPI" json:"bearerAPI"`
41+
Username string `yaml:"username" json:"username"`
42+
Password string `yaml:"password" json:"password"`
4343
}
4444

4545
type Response struct {
46-
Encoder string `yaml:"encoder" json:"encoder"`
47-
Body string `yaml:"body" json:"body"`
48-
Header map[string]string `yaml:"header" json:"header"`
49-
StatusCode int `yaml:"statusCode" json:"statusCode"`
50-
BodyData []byte
46+
Encoder string `yaml:"encoder" json:"encoder"`
47+
Body string `yaml:"body" json:"body"`
48+
Header map[string]string `yaml:"header" json:"header"`
49+
StatusCode int `yaml:"statusCode" json:"statusCode"`
50+
BodyData []byte
5151
}
5252

5353
type Webhook struct {
54-
Name string `yaml:"name" json:"name"`
55-
Timer string `yaml:"timer" json:"timer"`
56-
Request RequestWithAuth `yaml:"request" json:"request"`
54+
Name string `yaml:"name" json:"name"`
55+
Timer string `yaml:"timer" json:"timer"`
56+
Param map[string]string `yaml:"param" json:"param"`
57+
Request RequestWithAuth `yaml:"request" json:"request"`
5758
}
5859

5960
type Proxy struct {
60-
Prefix string `yaml:"prefix" json:"prefix"`
61-
Port int `yaml:"port" json:"port"`
62-
Path string `yaml:"path" json:"path"`
63-
Target string `yaml:"target" json:"target"`
64-
RequestAmend RequestAmend `yaml:"requestAmend" json:"requestAmend"`
65-
Protocol string `yaml:"protocol" json:"protocol"`
61+
Prefix string `yaml:"prefix" json:"prefix"`
62+
Port int `yaml:"port" json:"port"`
63+
Path string `yaml:"path" json:"path"`
64+
Target string `yaml:"target" json:"target"`
65+
RequestAmend RequestAmend `yaml:"requestAmend" json:"requestAmend"`
66+
Protocol string `yaml:"protocol" json:"protocol"`
6667
}
6768

6869
type RequestAmend struct {
69-
BodyPatch string `yaml:"bodyPatch" json:"bodyPatch"`
70+
BodyPatch string `yaml:"bodyPatch" json:"bodyPatch"`
7071
}
7172

7273
type Server struct {
73-
Objects []Object `yaml:"objects" json:"objects"`
74-
Items []Item `yaml:"items" json:"items"`
75-
Proxies []Proxy `yaml:"proxies" json:"proxies"`
76-
Webhooks []Webhook `yaml:"webhooks" json:"webhooks"`
74+
Objects []Object `yaml:"objects" json:"objects"`
75+
Items []Item `yaml:"items" json:"items"`
76+
Proxies []Proxy `yaml:"proxies" json:"proxies"`
77+
Webhooks []Webhook `yaml:"webhooks" json:"webhooks"`
7778
}

0 commit comments

Comments
 (0)