forked from brocaar/chirpstack-application-server
/
test.go
575 lines (464 loc) · 24.5 KB
/
test.go
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
package test
import (
"os"
"github.com/golang/protobuf/ptypes/empty"
"github.com/gomodule/redigo/redis"
migrate "github.com/rubenv/sql-migrate"
log "github.com/sirupsen/logrus"
"golang.org/x/net/context"
"google.golang.org/grpc"
"github.com/brocaar/lora-app-server/internal/common"
"github.com/brocaar/lora-app-server/internal/config"
"github.com/brocaar/lora-app-server/internal/migrations"
"github.com/brocaar/lora-app-server/internal/nsclient"
"github.com/brocaar/loraserver/api/ns"
)
// Config contains the test configuration.
type Config struct {
PostgresDSN string
RedisURL string
MQTTServer string
MQTTUsername string
MQTTPassword string
}
func init() {
config.C.ApplicationServer.ID = "6d5db27e-4ce2-4b2b-b5d7-91f069397978"
config.C.ApplicationServer.API.PublicHost = "localhost:8001"
}
// GetConfig returns the test configuration.
func GetConfig() *Config {
log.SetLevel(log.ErrorLevel)
c := &Config{
PostgresDSN: "postgres://localhost/loraserver_as_test?sslmode=disable",
RedisURL: "redis://localhost:6379",
MQTTServer: "tcp://localhost:1883",
}
if v := os.Getenv("TEST_POSTGRES_DSN"); v != "" {
c.PostgresDSN = v
}
if v := os.Getenv("TEST_REDIS_URL"); v != "" {
c.RedisURL = v
}
if v := os.Getenv("TEST_MQTT_SERVER"); v != "" {
c.MQTTServer = v
}
if v := os.Getenv("TEST_MQTT_USERNAME"); v != "" {
c.MQTTUsername = v
}
if v := os.Getenv("TEST_MQTT_PASSWORD"); v != "" {
c.MQTTPassword = v
}
return c
}
// MustResetDB re-applies all database migrations.
func MustResetDB(db *common.DBLogger) {
m := &migrate.AssetMigrationSource{
Asset: migrations.Asset,
AssetDir: migrations.AssetDir,
Dir: "",
}
if _, err := migrate.Exec(db.DB.DB, "postgres", m, migrate.Down); err != nil {
log.Fatal(err)
}
if _, err := migrate.Exec(db.DB.DB, "postgres", m, migrate.Up); err != nil {
log.Fatal(err)
}
}
// MustFlushRedis flushes the Redis storage.
func MustFlushRedis(p *redis.Pool) {
c := p.Get()
defer c.Close()
if _, err := c.Do("FLUSHALL"); err != nil {
log.Fatal(err)
}
}
// NetworkServerPool is a network-server pool for testing.
type NetworkServerPool struct {
Client ns.NetworkServerServiceClient
GetHostname string
}
// Get returns the Client.
func (p *NetworkServerPool) Get(hostname string, caCert, tlsCert, tlsKey []byte) (ns.NetworkServerServiceClient, error) {
p.GetHostname = hostname
return p.Client, nil
}
// NewNetworkServerPool creates a network-server client pool which always
// returns the given client on Get.
func NewNetworkServerPool(client *NetworkServerClient) nsclient.Pool {
return &NetworkServerPool{
Client: client,
}
}
// NetworkServerClient is a test network-server client.
type NetworkServerClient struct {
CreateServiceProfileChan chan ns.CreateServiceProfileRequest
CreateServiceProfileResponse ns.CreateServiceProfileResponse
GetServiceProfileChan chan ns.GetServiceProfileRequest
GetServiceProfileResponse ns.GetServiceProfileResponse
UpdateServiceProfileChan chan ns.UpdateServiceProfileRequest
UpdateServiceProfileResponse empty.Empty
DeleteServiceProfileChan chan ns.DeleteServiceProfileRequest
DeleteServiceProfileResponse empty.Empty
CreateRoutingProfileChan chan ns.CreateRoutingProfileRequest
CreateRoutingProfileResponse ns.CreateRoutingProfileResponse
GetRoutingProfileChan chan ns.GetRoutingProfileRequest
GetRoutingProfileResponse ns.GetRoutingProfileResponse
UpdateRoutingProfileChan chan ns.UpdateRoutingProfileRequest
UpdateRoutingProfileResponse empty.Empty
DeleteRoutingProfileChan chan ns.DeleteRoutingProfileRequest
DeleteRoutingProfileResponse empty.Empty
CreateDeviceProfileChan chan ns.CreateDeviceProfileRequest
CreateDeviceProfileResponse ns.CreateDeviceProfileResponse
GetDeviceProfileChan chan ns.GetDeviceProfileRequest
GetDeviceProfileResponse ns.GetDeviceProfileResponse
UpdateDeviceProfileChan chan ns.UpdateDeviceProfileRequest
UpdateDeviceProfileResponse empty.Empty
DeleteDeviceProfileChan chan ns.DeleteDeviceProfileRequest
DeleteDeviceProfileResponse empty.Empty
CreateDeviceChan chan ns.CreateDeviceRequest
CreateDeviceResponse empty.Empty
GetDeviceChan chan ns.GetDeviceRequest
GetDeviceResponse ns.GetDeviceResponse
UpdateDeviceChan chan ns.UpdateDeviceRequest
UpdateDeviceResponse empty.Empty
DeleteDeviceChan chan ns.DeleteDeviceRequest
DeleteDeviceResponse empty.Empty
ActivateDeviceChan chan ns.ActivateDeviceRequest
ActivateDeviceResponse empty.Empty
DeactivateDeviceChan chan ns.DeactivateDeviceRequest
DeactivateDeviceResponse empty.Empty
GetDeviceActivationChan chan ns.GetDeviceActivationRequest
GetDeviceActivationResponse ns.GetDeviceActivationResponse
GetRandomDevAddrChan chan empty.Empty
GetRandomDevAddrResponse ns.GetRandomDevAddrResponse
CreateMACCommandQueueItemChan chan ns.CreateMACCommandQueueItemRequest
CreateMACCommandQueueItemResponse empty.Empty
SendProprietaryPayloadChan chan ns.SendProprietaryPayloadRequest
SendProprietaryPayloadResponse empty.Empty
CreateGatewayChan chan ns.CreateGatewayRequest
CreateGatewayResponse empty.Empty
GetGatewayChan chan ns.GetGatewayRequest
GetGatewayResponse ns.GetGatewayResponse
UpdateGatewayChan chan ns.UpdateGatewayRequest
UpdateGatewayResponse empty.Empty
DeleteGatewayChan chan ns.DeleteGatewayRequest
DeleteGatewayResponse empty.Empty
GetGatewayStatsChan chan ns.GetGatewayStatsRequest
GetGatewayStatsResponse ns.GetGatewayStatsResponse
CreateGatewayProfileChan chan ns.CreateGatewayProfileRequest
CreateGatewayProfileResponse ns.CreateGatewayProfileResponse
GetGatewayProfileChan chan ns.GetGatewayProfileRequest
GetGatewayProfileResponse ns.GetGatewayProfileResponse
UpdateGatewayProfileChan chan ns.UpdateGatewayProfileRequest
UpdateGatewayProfileResponse empty.Empty
DeleteGatewayProfileChan chan ns.DeleteGatewayProfileRequest
DeleteGatewayProfileResponse empty.Empty
CreateDeviceQueueItemChan chan ns.CreateDeviceQueueItemRequest
CreateDeviceQueueItemResponse empty.Empty
FlushDeviceQueueForDevEUIChan chan ns.FlushDeviceQueueForDevEUIRequest
FlushDeviceQueueForDevEUIResponse empty.Empty
GetDeviceQueueItemsForDevEUIChan chan ns.GetDeviceQueueItemsForDevEUIRequest
GetDeviceQueueItemsForDevEUIResponse ns.GetDeviceQueueItemsForDevEUIResponse
GetNextDownlinkFCntForDevEUIChan chan ns.GetNextDownlinkFCntForDevEUIRequest
GetNextDownlinkFCntForDevEUIResponse ns.GetNextDownlinkFCntForDevEUIResponse
CreateMulticastGroupChan chan ns.CreateMulticastGroupRequest
CreateMulticastGroupResponse ns.CreateMulticastGroupResponse
GetMulticastGroupChan chan ns.GetMulticastGroupRequest
GetMulticastGroupResponse ns.GetMulticastGroupResponse
UpdateMulticastGroupChan chan ns.UpdateMulticastGroupRequest
UpdateMulticastGroupResponse empty.Empty
DeleteMulticastGroupChan chan ns.DeleteMulticastGroupRequest
DeleteMulticastGroupResponse empty.Empty
AddDeviceToMulticastGroupChan chan ns.AddDeviceToMulticastGroupRequest
AddDeviceToMulticastGroupResponse empty.Empty
RemoveDeviceFromMulticastGroupChan chan ns.RemoveDeviceFromMulticastGroupRequest
RemoveDeviceFromMulticastGroupResponse empty.Empty
EnqueueMulticastQueueItemChan chan ns.EnqueueMulticastQueueItemRequest
EnqueueMulticastQueueItemResponse empty.Empty
FlushMulticastQueueForMulticastGroupChan chan ns.FlushMulticastQueueForMulticastGroupRequest
FlushMulticastQueueForMulticastGroupResponse empty.Empty
GetMulticastQueueItemsForMulticastGroupChan chan ns.GetMulticastQueueItemsForMulticastGroupRequest
GetMulticastQueueItemsForMulticastGroupResponse ns.GetMulticastQueueItemsForMulticastGroupResponse
GetVersionResponse ns.GetVersionResponse
}
// NewNetworkServerClient creates a new NetworkServerClient.
func NewNetworkServerClient() *NetworkServerClient {
return &NetworkServerClient{
CreateServiceProfileChan: make(chan ns.CreateServiceProfileRequest, 100),
GetServiceProfileChan: make(chan ns.GetServiceProfileRequest, 100),
UpdateServiceProfileChan: make(chan ns.UpdateServiceProfileRequest, 100),
DeleteServiceProfileChan: make(chan ns.DeleteServiceProfileRequest, 100),
CreateRoutingProfileChan: make(chan ns.CreateRoutingProfileRequest, 100),
GetRoutingProfileChan: make(chan ns.GetRoutingProfileRequest, 100),
UpdateRoutingProfileChan: make(chan ns.UpdateRoutingProfileRequest, 100),
DeleteRoutingProfileChan: make(chan ns.DeleteRoutingProfileRequest, 100),
CreateDeviceProfileChan: make(chan ns.CreateDeviceProfileRequest, 100),
GetDeviceProfileChan: make(chan ns.GetDeviceProfileRequest, 100),
UpdateDeviceProfileChan: make(chan ns.UpdateDeviceProfileRequest, 100),
DeleteDeviceProfileChan: make(chan ns.DeleteDeviceProfileRequest, 100),
CreateDeviceChan: make(chan ns.CreateDeviceRequest, 100),
GetDeviceChan: make(chan ns.GetDeviceRequest, 100),
UpdateDeviceChan: make(chan ns.UpdateDeviceRequest, 100),
DeleteDeviceChan: make(chan ns.DeleteDeviceRequest, 100),
ActivateDeviceChan: make(chan ns.ActivateDeviceRequest, 100),
DeactivateDeviceChan: make(chan ns.DeactivateDeviceRequest, 100),
GetDeviceActivationChan: make(chan ns.GetDeviceActivationRequest, 100),
GetRandomDevAddrChan: make(chan empty.Empty, 100),
CreateMACCommandQueueItemChan: make(chan ns.CreateMACCommandQueueItemRequest, 100),
SendProprietaryPayloadChan: make(chan ns.SendProprietaryPayloadRequest, 100),
CreateGatewayChan: make(chan ns.CreateGatewayRequest, 100),
GetGatewayChan: make(chan ns.GetGatewayRequest, 100),
UpdateGatewayChan: make(chan ns.UpdateGatewayRequest, 100),
DeleteGatewayChan: make(chan ns.DeleteGatewayRequest, 100),
GetGatewayStatsChan: make(chan ns.GetGatewayStatsRequest, 100),
CreateGatewayProfileChan: make(chan ns.CreateGatewayProfileRequest, 100),
GetGatewayProfileChan: make(chan ns.GetGatewayProfileRequest, 100),
UpdateGatewayProfileChan: make(chan ns.UpdateGatewayProfileRequest, 100),
DeleteGatewayProfileChan: make(chan ns.DeleteGatewayProfileRequest, 100),
GetNextDownlinkFCntForDevEUIChan: make(chan ns.GetNextDownlinkFCntForDevEUIRequest, 100),
CreateDeviceQueueItemChan: make(chan ns.CreateDeviceQueueItemRequest, 100),
FlushDeviceQueueForDevEUIChan: make(chan ns.FlushDeviceQueueForDevEUIRequest, 100),
GetDeviceQueueItemsForDevEUIChan: make(chan ns.GetDeviceQueueItemsForDevEUIRequest, 100),
CreateMulticastGroupChan: make(chan ns.CreateMulticastGroupRequest, 100),
GetMulticastGroupChan: make(chan ns.GetMulticastGroupRequest, 100),
UpdateMulticastGroupChan: make(chan ns.UpdateMulticastGroupRequest, 100),
DeleteMulticastGroupChan: make(chan ns.DeleteMulticastGroupRequest, 100),
AddDeviceToMulticastGroupChan: make(chan ns.AddDeviceToMulticastGroupRequest, 100),
RemoveDeviceFromMulticastGroupChan: make(chan ns.RemoveDeviceFromMulticastGroupRequest, 100),
EnqueueMulticastQueueItemChan: make(chan ns.EnqueueMulticastQueueItemRequest, 100),
FlushMulticastQueueForMulticastGroupChan: make(chan ns.FlushMulticastQueueForMulticastGroupRequest, 100),
GetMulticastQueueItemsForMulticastGroupChan: make(chan ns.GetMulticastQueueItemsForMulticastGroupRequest, 100),
}
}
// CreateServiceProfile method.
func (n *NetworkServerClient) CreateServiceProfile(ctx context.Context, in *ns.CreateServiceProfileRequest, opts ...grpc.CallOption) (*ns.CreateServiceProfileResponse, error) {
n.CreateServiceProfileChan <- *in
return &n.CreateServiceProfileResponse, nil
}
// GetServiceProfile method.
func (n *NetworkServerClient) GetServiceProfile(ctx context.Context, in *ns.GetServiceProfileRequest, opts ...grpc.CallOption) (*ns.GetServiceProfileResponse, error) {
n.GetServiceProfileChan <- *in
return &n.GetServiceProfileResponse, nil
}
// UpdateServiceProfile method.
func (n *NetworkServerClient) UpdateServiceProfile(ctx context.Context, in *ns.UpdateServiceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateServiceProfileChan <- *in
return &n.UpdateServiceProfileResponse, nil
}
// DeleteServiceProfile method.
func (n *NetworkServerClient) DeleteServiceProfile(ctx context.Context, in *ns.DeleteServiceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteServiceProfileChan <- *in
return &n.DeleteServiceProfileResponse, nil
}
// CreateRoutingProfile method.
func (n *NetworkServerClient) CreateRoutingProfile(ctx context.Context, in *ns.CreateRoutingProfileRequest, opts ...grpc.CallOption) (*ns.CreateRoutingProfileResponse, error) {
n.CreateRoutingProfileChan <- *in
return &n.CreateRoutingProfileResponse, nil
}
// GetRoutingProfile method.
func (n *NetworkServerClient) GetRoutingProfile(ctx context.Context, in *ns.GetRoutingProfileRequest, opts ...grpc.CallOption) (*ns.GetRoutingProfileResponse, error) {
n.GetRoutingProfileChan <- *in
return &n.GetRoutingProfileResponse, nil
}
// UpdateRoutingProfile method.
func (n *NetworkServerClient) UpdateRoutingProfile(ctx context.Context, in *ns.UpdateRoutingProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateRoutingProfileChan <- *in
return &n.UpdateRoutingProfileResponse, nil
}
// DeleteRoutingProfile method.
func (n *NetworkServerClient) DeleteRoutingProfile(ctx context.Context, in *ns.DeleteRoutingProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteRoutingProfileChan <- *in
return &n.DeleteRoutingProfileResponse, nil
}
// CreateDeviceProfile method.
func (n *NetworkServerClient) CreateDeviceProfile(ctx context.Context, in *ns.CreateDeviceProfileRequest, opts ...grpc.CallOption) (*ns.CreateDeviceProfileResponse, error) {
n.CreateDeviceProfileChan <- *in
return &n.CreateDeviceProfileResponse, nil
}
// GetDeviceProfile method.
func (n *NetworkServerClient) GetDeviceProfile(ctx context.Context, in *ns.GetDeviceProfileRequest, opts ...grpc.CallOption) (*ns.GetDeviceProfileResponse, error) {
n.GetDeviceProfileChan <- *in
return &n.GetDeviceProfileResponse, nil
}
// UpdateDeviceProfile method.
func (n *NetworkServerClient) UpdateDeviceProfile(ctx context.Context, in *ns.UpdateDeviceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateDeviceProfileChan <- *in
return &n.UpdateDeviceProfileResponse, nil
}
// DeleteDeviceProfile method.
func (n *NetworkServerClient) DeleteDeviceProfile(ctx context.Context, in *ns.DeleteDeviceProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteDeviceProfileChan <- *in
return &n.DeleteDeviceProfileResponse, nil
}
// CreateDevice method.
func (n *NetworkServerClient) CreateDevice(ctx context.Context, in *ns.CreateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.CreateDeviceChan <- *in
return &n.CreateDeviceResponse, nil
}
// GetDevice method.
func (n *NetworkServerClient) GetDevice(ctx context.Context, in *ns.GetDeviceRequest, opts ...grpc.CallOption) (*ns.GetDeviceResponse, error) {
n.GetDeviceChan <- *in
return &n.GetDeviceResponse, nil
}
// UpdateDevice method.
func (n *NetworkServerClient) UpdateDevice(ctx context.Context, in *ns.UpdateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateDeviceChan <- *in
return &n.UpdateDeviceResponse, nil
}
// DeleteDevice method.
func (n *NetworkServerClient) DeleteDevice(ctx context.Context, in *ns.DeleteDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteDeviceChan <- *in
return &n.DeleteDeviceResponse, nil
}
// ActivateDevice method.
func (n *NetworkServerClient) ActivateDevice(ctx context.Context, in *ns.ActivateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.ActivateDeviceChan <- *in
return &n.ActivateDeviceResponse, nil
}
// GetDeviceActivation method.
func (n *NetworkServerClient) GetDeviceActivation(ctx context.Context, in *ns.GetDeviceActivationRequest, opts ...grpc.CallOption) (*ns.GetDeviceActivationResponse, error) {
n.GetDeviceActivationChan <- *in
return &n.GetDeviceActivationResponse, nil
}
// DeactivateDevice method.
func (n *NetworkServerClient) DeactivateDevice(ctx context.Context, in *ns.DeactivateDeviceRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeactivateDeviceChan <- *in
return &n.DeactivateDeviceResponse, nil
}
// CreateGateway method.
func (n *NetworkServerClient) CreateGateway(ctx context.Context, in *ns.CreateGatewayRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.CreateGatewayChan <- *in
return &n.CreateGatewayResponse, nil
}
// GetGateway method.
func (n *NetworkServerClient) GetGateway(ctx context.Context, in *ns.GetGatewayRequest, opts ...grpc.CallOption) (*ns.GetGatewayResponse, error) {
n.GetGatewayChan <- *in
return &n.GetGatewayResponse, nil
}
// UpdateGateway method.
func (n *NetworkServerClient) UpdateGateway(ctx context.Context, in *ns.UpdateGatewayRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateGatewayChan <- *in
return &n.UpdateGatewayResponse, nil
}
// DeleteGateway method.
func (n *NetworkServerClient) DeleteGateway(ctx context.Context, in *ns.DeleteGatewayRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteGatewayChan <- *in
return &n.DeleteGatewayResponse, nil
}
// GetGatewayStats method.
func (n *NetworkServerClient) GetGatewayStats(ctx context.Context, in *ns.GetGatewayStatsRequest, opts ...grpc.CallOption) (*ns.GetGatewayStatsResponse, error) {
n.GetGatewayStatsChan <- *in
return &n.GetGatewayStatsResponse, nil
}
// GetRandomDevAddr method.
func (n *NetworkServerClient) GetRandomDevAddr(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ns.GetRandomDevAddrResponse, error) {
n.GetRandomDevAddrChan <- *in
return &n.GetRandomDevAddrResponse, nil
}
// CreateMACCommandQueueItem method.
func (n *NetworkServerClient) CreateMACCommandQueueItem(ctx context.Context, in *ns.CreateMACCommandQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.CreateMACCommandQueueItemChan <- *in
return &n.CreateMACCommandQueueItemResponse, nil
}
// SendProprietaryPayload method.
func (n *NetworkServerClient) SendProprietaryPayload(ctx context.Context, in *ns.SendProprietaryPayloadRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.SendProprietaryPayloadChan <- *in
return &n.SendProprietaryPayloadResponse, nil
}
// CreateGatewayProfile method.
func (n *NetworkServerClient) CreateGatewayProfile(ctx context.Context, in *ns.CreateGatewayProfileRequest, opts ...grpc.CallOption) (*ns.CreateGatewayProfileResponse, error) {
n.CreateGatewayProfileChan <- *in
return &n.CreateGatewayProfileResponse, nil
}
// GetGatewayProfile method.
func (n *NetworkServerClient) GetGatewayProfile(ctx context.Context, in *ns.GetGatewayProfileRequest, opts ...grpc.CallOption) (*ns.GetGatewayProfileResponse, error) {
n.GetGatewayProfileChan <- *in
return &n.GetGatewayProfileResponse, nil
}
// UpdateGatewayProfile method.
func (n *NetworkServerClient) UpdateGatewayProfile(ctx context.Context, in *ns.UpdateGatewayProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateGatewayProfileChan <- *in
return &n.UpdateGatewayProfileResponse, nil
}
// DeleteGatewayProfile method.
func (n *NetworkServerClient) DeleteGatewayProfile(ctx context.Context, in *ns.DeleteGatewayProfileRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteGatewayProfileChan <- *in
return &n.DeleteGatewayProfileResponse, nil
}
// CreateDeviceQueueItem method.
func (n NetworkServerClient) CreateDeviceQueueItem(ctx context.Context, in *ns.CreateDeviceQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.CreateDeviceQueueItemChan <- *in
return &n.CreateDeviceQueueItemResponse, nil
}
// FlushDeviceQueueForDevEUI method.
func (n NetworkServerClient) FlushDeviceQueueForDevEUI(ctx context.Context, in *ns.FlushDeviceQueueForDevEUIRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.FlushDeviceQueueForDevEUIChan <- *in
return &n.FlushDeviceQueueForDevEUIResponse, nil
}
// GetDeviceQueueItemsForDevEUI method.
func (n NetworkServerClient) GetDeviceQueueItemsForDevEUI(ctx context.Context, in *ns.GetDeviceQueueItemsForDevEUIRequest, opts ...grpc.CallOption) (*ns.GetDeviceQueueItemsForDevEUIResponse, error) {
n.GetDeviceQueueItemsForDevEUIChan <- *in
return &n.GetDeviceQueueItemsForDevEUIResponse, nil
}
// GetNextDownlinkFCntForDevEUI method.
func (n NetworkServerClient) GetNextDownlinkFCntForDevEUI(ctx context.Context, in *ns.GetNextDownlinkFCntForDevEUIRequest, opts ...grpc.CallOption) (*ns.GetNextDownlinkFCntForDevEUIResponse, error) {
n.GetNextDownlinkFCntForDevEUIChan <- *in
return &n.GetNextDownlinkFCntForDevEUIResponse, nil
}
// GetVersion method.
func (n NetworkServerClient) GetVersion(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*ns.GetVersionResponse, error) {
return &n.GetVersionResponse, nil
}
// StreamFrameLogsForGateway method.
func (n NetworkServerClient) StreamFrameLogsForGateway(ctx context.Context, in *ns.StreamFrameLogsForGatewayRequest, opts ...grpc.CallOption) (ns.NetworkServerService_StreamFrameLogsForGatewayClient, error) {
panic("not implemented")
}
// StreamFrameLogsForDevice method.
func (n NetworkServerClient) StreamFrameLogsForDevice(ctx context.Context, in *ns.StreamFrameLogsForDeviceRequest, opts ...grpc.CallOption) (ns.NetworkServerService_StreamFrameLogsForDeviceClient, error) {
panic("not implemented")
}
// CreateMulticastGroup method.
func (n NetworkServerClient) CreateMulticastGroup(ctx context.Context, in *ns.CreateMulticastGroupRequest, opts ...grpc.CallOption) (*ns.CreateMulticastGroupResponse, error) {
n.CreateMulticastGroupChan <- *in
return &n.CreateMulticastGroupResponse, nil
}
// GetMulticastGroup method.
func (n NetworkServerClient) GetMulticastGroup(ctx context.Context, in *ns.GetMulticastGroupRequest, opts ...grpc.CallOption) (*ns.GetMulticastGroupResponse, error) {
n.GetMulticastGroupChan <- *in
return &n.GetMulticastGroupResponse, nil
}
// UpdateMulticastGroup method.
func (n NetworkServerClient) UpdateMulticastGroup(ctx context.Context, in *ns.UpdateMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.UpdateMulticastGroupChan <- *in
return &n.UpdateMulticastGroupResponse, nil
}
// DeleteMulticastGroup method.
func (n NetworkServerClient) DeleteMulticastGroup(ctx context.Context, in *ns.DeleteMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.DeleteMulticastGroupChan <- *in
return &n.DeleteMulticastGroupResponse, nil
}
// AddDeviceToMulticastGroup method.
func (n NetworkServerClient) AddDeviceToMulticastGroup(ctx context.Context, in *ns.AddDeviceToMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.AddDeviceToMulticastGroupChan <- *in
return &n.AddDeviceToMulticastGroupResponse, nil
}
// RemoveDeviceFromMulticastGroup method.
func (n NetworkServerClient) RemoveDeviceFromMulticastGroup(ctx context.Context, in *ns.RemoveDeviceFromMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.RemoveDeviceFromMulticastGroupChan <- *in
return &n.RemoveDeviceFromMulticastGroupResponse, nil
}
// EnqueueMulticastQueueItem method.
func (n NetworkServerClient) EnqueueMulticastQueueItem(ctx context.Context, in *ns.EnqueueMulticastQueueItemRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.EnqueueMulticastQueueItemChan <- *in
return &n.EnqueueMulticastQueueItemResponse, nil
}
// FlushMulticastQueueForMulticastGroup method.
func (n NetworkServerClient) FlushMulticastQueueForMulticastGroup(ctx context.Context, in *ns.FlushMulticastQueueForMulticastGroupRequest, opts ...grpc.CallOption) (*empty.Empty, error) {
n.FlushMulticastQueueForMulticastGroupChan <- *in
return &n.FlushMulticastQueueForMulticastGroupResponse, nil
}
// GetMulticastQueueItemsForMulticastGroup method.
func (n NetworkServerClient) GetMulticastQueueItemsForMulticastGroup(ctx context.Context, in *ns.GetMulticastQueueItemsForMulticastGroupRequest, opts ...grpc.CallOption) (*ns.GetMulticastQueueItemsForMulticastGroupResponse, error) {
n.GetMulticastQueueItemsForMulticastGroupChan <- *in
return &n.GetMulticastQueueItemsForMulticastGroupResponse, nil
}