@@ -13,7 +13,7 @@ import (
13
13
"go.uber.org/zap"
14
14
15
15
"gitlab.com/inetmock/inetmock/internal/format"
16
- rpcV1 "gitlab.com/inetmock/inetmock/pkg/rpc/v1"
16
+ rpcv1 "gitlab.com/inetmock/inetmock/pkg/rpc/v1"
17
17
)
18
18
19
19
const (
@@ -57,11 +57,11 @@ var (
57
57
}
58
58
59
59
var err error
60
- pcapClient := rpcV1 .NewPCAPServiceClient (conn )
60
+ pcapClient := rpcv1 .NewPCAPServiceClient (conn )
61
61
ctx , cancel := context .WithTimeout (context .Background (), cfg .GRPCTimeout )
62
62
defer cancel ()
63
- var resp * rpcV1 .ListAvailableDevicesResponse
64
- if resp , err = pcapClient .ListAvailableDevices (ctx , new (rpcV1 .ListAvailableDevicesRequest )); err == nil {
63
+ var resp * rpcv1 .ListAvailableDevicesResponse
64
+ if resp , err = pcapClient .ListAvailableDevices (ctx , new (rpcv1 .ListAvailableDevicesRequest )); err == nil {
65
65
var completions []string
66
66
67
67
for _ , d := range resp .AvailableDevices {
@@ -93,11 +93,11 @@ var (
93
93
Args : cobra .ExactArgs (1 ),
94
94
ValidArgsFunction : func (* cobra.Command , []string , string ) ([]string , cobra.ShellCompDirective ) {
95
95
var err error
96
- pcapClient := rpcV1 .NewPCAPServiceClient (conn )
96
+ pcapClient := rpcv1 .NewPCAPServiceClient (conn )
97
97
ctx , cancel := context .WithTimeout (context .Background (), cfg .GRPCTimeout )
98
98
defer cancel ()
99
- var resp * rpcV1 .ListActiveRecordingsResponse
100
- if resp , err = pcapClient .ListActiveRecordings (ctx , new (rpcV1 .ListActiveRecordingsRequest )); err == nil {
99
+ var resp * rpcv1 .ListActiveRecordingsResponse
100
+ if resp , err = pcapClient .ListActiveRecordings (ctx , new (rpcv1 .ListActiveRecordingsRequest )); err == nil {
101
101
return resp .Subscriptions , cobra .ShellCompDirectiveNoFileComp
102
102
}
103
103
return nil , cobra .ShellCompDirectiveError
@@ -130,12 +130,12 @@ func init() {
130
130
}
131
131
132
132
func runListAvailableDevices (* cobra.Command , []string ) (err error ) {
133
- pcapClient := rpcV1 .NewPCAPServiceClient (conn )
133
+ pcapClient := rpcv1 .NewPCAPServiceClient (conn )
134
134
ctx , cancel := context .WithTimeout (cliApp .Context (), cfg .GRPCTimeout )
135
135
defer cancel ()
136
136
137
- var resp * rpcV1 .ListAvailableDevicesResponse
138
- if resp , err = pcapClient .ListAvailableDevices (ctx , new (rpcV1 .ListAvailableDevicesRequest )); err != nil {
137
+ var resp * rpcv1 .ListAvailableDevicesResponse
138
+ if resp , err = pcapClient .ListAvailableDevices (ctx , new (rpcv1 .ListAvailableDevicesRequest )); err != nil {
139
139
return
140
140
}
141
141
@@ -165,14 +165,14 @@ func runListActiveRecordings(*cobra.Command, []string) error {
165
165
ConsumerKey string
166
166
}
167
167
168
- pcapClient := rpcV1 .NewPCAPServiceClient (conn )
168
+ pcapClient := rpcv1 .NewPCAPServiceClient (conn )
169
169
170
170
ctx , cancel := context .WithTimeout (cliApp .Context (), cfg .GRPCTimeout )
171
171
defer cancel ()
172
172
173
173
var err error
174
- var resp * rpcV1 .ListActiveRecordingsResponse
175
- if resp , err = pcapClient .ListActiveRecordings (ctx , new (rpcV1 .ListActiveRecordingsRequest )); err != nil {
174
+ var resp * rpcv1 .ListActiveRecordingsResponse
175
+ if resp , err = pcapClient .ListActiveRecordings (ctx , new (rpcv1 .ListActiveRecordingsRequest )); err != nil {
176
176
return err
177
177
}
178
178
@@ -197,7 +197,7 @@ func runListActiveRecordings(*cobra.Command, []string) error {
197
197
}
198
198
199
199
func runAddRecording (_ * cobra.Command , args []string ) (err error ) {
200
- pcapClient := rpcV1 .NewPCAPServiceClient (conn )
200
+ pcapClient := rpcv1 .NewPCAPServiceClient (conn )
201
201
202
202
if err = isValidRecordDevice (args [0 ], pcapClient ); err != nil {
203
203
return
@@ -206,8 +206,8 @@ func runAddRecording(_ *cobra.Command, args []string) (err error) {
206
206
ctx , cancel := context .WithTimeout (cliApp .Context (), cfg .GRPCTimeout )
207
207
defer cancel ()
208
208
209
- var resp * rpcV1 .StartPCAPFileRecordingResponse
210
- resp , err = pcapClient .StartPCAPFileRecording (ctx , & rpcV1 .StartPCAPFileRecordingRequest {
209
+ var resp * rpcv1 .StartPCAPFileRecordingResponse
210
+ resp , err = pcapClient .StartPCAPFileRecording (ctx , & rpcv1 .StartPCAPFileRecordingRequest {
211
211
Device : args [0 ],
212
212
TargetPath : args [1 ],
213
213
})
@@ -222,14 +222,14 @@ func runAddRecording(_ *cobra.Command, args []string) (err error) {
222
222
}
223
223
224
224
func runRemoveCurrentlyRunningRecording (_ * cobra.Command , args []string ) error {
225
- pcapClient := rpcV1 .NewPCAPServiceClient (conn )
225
+ pcapClient := rpcv1 .NewPCAPServiceClient (conn )
226
226
227
227
listRecsCtx , listRecsCancel := context .WithTimeout (cliApp .Context (), cfg .GRPCTimeout )
228
228
defer listRecsCancel ()
229
229
230
230
var err error
231
- var listRecsResp * rpcV1 .ListActiveRecordingsResponse
232
- if listRecsResp , err = pcapClient .ListActiveRecordings (listRecsCtx , new (rpcV1 .ListActiveRecordingsRequest )); err != nil {
231
+ var listRecsResp * rpcv1 .ListActiveRecordingsResponse
232
+ if listRecsResp , err = pcapClient .ListActiveRecordings (listRecsCtx , new (rpcv1 .ListActiveRecordingsRequest )); err != nil {
233
233
return err
234
234
}
235
235
@@ -248,8 +248,8 @@ func runRemoveCurrentlyRunningRecording(_ *cobra.Command, args []string) error {
248
248
ctx , cancel := context .WithTimeout (cliApp .Context (), cfg .GRPCTimeout )
249
249
defer cancel ()
250
250
251
- var stopRecResp * rpcV1 .StopPCAPFileRecordingResponse
252
- stopRecResp , err = pcapClient .StopPCAPFileRecording (ctx , & rpcV1 .StopPCAPFileRecordingRequest {
251
+ var stopRecResp * rpcv1 .StopPCAPFileRecordingResponse
252
+ stopRecResp , err = pcapClient .StopPCAPFileRecording (ctx , & rpcv1 .StopPCAPFileRecordingRequest {
253
253
ConsumerKey : args [0 ],
254
254
})
255
255
@@ -263,11 +263,11 @@ func runRemoveCurrentlyRunningRecording(_ *cobra.Command, args []string) error {
263
263
return nil
264
264
}
265
265
266
- func isValidRecordDevice (device string , pcapClient rpcV1 .PCAPServiceClient ) (err error ) {
266
+ func isValidRecordDevice (device string , pcapClient rpcv1 .PCAPServiceClient ) (err error ) {
267
267
ctx , cancel := context .WithTimeout (cliApp .Context (), cfg .GRPCTimeout )
268
268
defer cancel ()
269
- var resp * rpcV1 .ListAvailableDevicesResponse
270
- if resp , err = pcapClient .ListAvailableDevices (ctx , new (rpcV1 .ListAvailableDevicesRequest )); err != nil {
269
+ var resp * rpcv1 .ListAvailableDevicesResponse
270
+ if resp , err = pcapClient .ListAvailableDevices (ctx , new (rpcv1 .ListAvailableDevicesRequest )); err != nil {
271
271
return
272
272
}
273
273
0 commit comments