forked from uber/zanzibar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
baz_test_server.go
1219 lines (1025 loc) · 41 KB
/
baz_test_server.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
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by zanzibar
// @generated
// Copyright (c) 2018 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
package bazclient
import (
"context"
"errors"
zanzibar "github.com/uber/zanzibar/runtime"
"go.uber.org/thriftrw/wire"
clientsBazBase "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients/baz/base"
clientsBazBaz "github.com/uber/zanzibar/examples/example-gateway/build/gen-code/clients/baz/baz"
)
// SecondServiceEchoBinaryFunc is the handler function for "echoBinary" method of thrift service "SecondService".
type SecondServiceEchoBinaryFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoBinary_Args,
) ([]byte, map[string]string, error)
// NewSecondServiceEchoBinaryHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoBinaryHandler(f SecondServiceEchoBinaryFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoBinaryHandler{f}
}
// SecondServiceEchoBinaryHandler handles the "echoBinary" method call of thrift service "SecondService".
type SecondServiceEchoBinaryHandler struct {
echobinary SecondServiceEchoBinaryFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoBinaryHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoBinary_Args
var res clientsBazBaz.SecondService_EchoBinary_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echobinary(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoBoolFunc is the handler function for "echoBool" method of thrift service "SecondService".
type SecondServiceEchoBoolFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoBool_Args,
) (bool, map[string]string, error)
// NewSecondServiceEchoBoolHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoBoolHandler(f SecondServiceEchoBoolFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoBoolHandler{f}
}
// SecondServiceEchoBoolHandler handles the "echoBool" method call of thrift service "SecondService".
type SecondServiceEchoBoolHandler struct {
echobool SecondServiceEchoBoolFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoBoolHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoBool_Args
var res clientsBazBaz.SecondService_EchoBool_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echobool(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoDoubleFunc is the handler function for "echoDouble" method of thrift service "SecondService".
type SecondServiceEchoDoubleFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoDouble_Args,
) (float64, map[string]string, error)
// NewSecondServiceEchoDoubleHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoDoubleHandler(f SecondServiceEchoDoubleFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoDoubleHandler{f}
}
// SecondServiceEchoDoubleHandler handles the "echoDouble" method call of thrift service "SecondService".
type SecondServiceEchoDoubleHandler struct {
echodouble SecondServiceEchoDoubleFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoDoubleHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoDouble_Args
var res clientsBazBaz.SecondService_EchoDouble_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echodouble(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoEnumFunc is the handler function for "echoEnum" method of thrift service "SecondService".
type SecondServiceEchoEnumFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoEnum_Args,
) (clientsBazBaz.Fruit, map[string]string, error)
// NewSecondServiceEchoEnumHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoEnumHandler(f SecondServiceEchoEnumFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoEnumHandler{f}
}
// SecondServiceEchoEnumHandler handles the "echoEnum" method call of thrift service "SecondService".
type SecondServiceEchoEnumHandler struct {
echoenum SecondServiceEchoEnumFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoEnumHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoEnum_Args
var res clientsBazBaz.SecondService_EchoEnum_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echoenum(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoI16Func is the handler function for "echoI16" method of thrift service "SecondService".
type SecondServiceEchoI16Func func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoI16_Args,
) (int16, map[string]string, error)
// NewSecondServiceEchoI16Handler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoI16Handler(f SecondServiceEchoI16Func) zanzibar.TChannelHandler {
return &SecondServiceEchoI16Handler{f}
}
// SecondServiceEchoI16Handler handles the "echoI16" method call of thrift service "SecondService".
type SecondServiceEchoI16Handler struct {
echoi16 SecondServiceEchoI16Func
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoI16Handler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoI16_Args
var res clientsBazBaz.SecondService_EchoI16_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echoi16(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoI32Func is the handler function for "echoI32" method of thrift service "SecondService".
type SecondServiceEchoI32Func func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoI32_Args,
) (int32, map[string]string, error)
// NewSecondServiceEchoI32Handler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoI32Handler(f SecondServiceEchoI32Func) zanzibar.TChannelHandler {
return &SecondServiceEchoI32Handler{f}
}
// SecondServiceEchoI32Handler handles the "echoI32" method call of thrift service "SecondService".
type SecondServiceEchoI32Handler struct {
echoi32 SecondServiceEchoI32Func
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoI32Handler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoI32_Args
var res clientsBazBaz.SecondService_EchoI32_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echoi32(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoI64Func is the handler function for "echoI64" method of thrift service "SecondService".
type SecondServiceEchoI64Func func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoI64_Args,
) (int64, map[string]string, error)
// NewSecondServiceEchoI64Handler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoI64Handler(f SecondServiceEchoI64Func) zanzibar.TChannelHandler {
return &SecondServiceEchoI64Handler{f}
}
// SecondServiceEchoI64Handler handles the "echoI64" method call of thrift service "SecondService".
type SecondServiceEchoI64Handler struct {
echoi64 SecondServiceEchoI64Func
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoI64Handler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoI64_Args
var res clientsBazBaz.SecondService_EchoI64_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echoi64(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoI8Func is the handler function for "echoI8" method of thrift service "SecondService".
type SecondServiceEchoI8Func func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoI8_Args,
) (int8, map[string]string, error)
// NewSecondServiceEchoI8Handler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoI8Handler(f SecondServiceEchoI8Func) zanzibar.TChannelHandler {
return &SecondServiceEchoI8Handler{f}
}
// SecondServiceEchoI8Handler handles the "echoI8" method call of thrift service "SecondService".
type SecondServiceEchoI8Handler struct {
echoi8 SecondServiceEchoI8Func
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoI8Handler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoI8_Args
var res clientsBazBaz.SecondService_EchoI8_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echoi8(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoStringFunc is the handler function for "echoString" method of thrift service "SecondService".
type SecondServiceEchoStringFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoString_Args,
) (string, map[string]string, error)
// NewSecondServiceEchoStringHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoStringHandler(f SecondServiceEchoStringFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoStringHandler{f}
}
// SecondServiceEchoStringHandler handles the "echoString" method call of thrift service "SecondService".
type SecondServiceEchoStringHandler struct {
echostring SecondServiceEchoStringFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoStringHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoString_Args
var res clientsBazBaz.SecondService_EchoString_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echostring(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoStringListFunc is the handler function for "echoStringList" method of thrift service "SecondService".
type SecondServiceEchoStringListFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoStringList_Args,
) ([]string, map[string]string, error)
// NewSecondServiceEchoStringListHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoStringListHandler(f SecondServiceEchoStringListFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoStringListHandler{f}
}
// SecondServiceEchoStringListHandler handles the "echoStringList" method call of thrift service "SecondService".
type SecondServiceEchoStringListHandler struct {
echostringlist SecondServiceEchoStringListFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoStringListHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoStringList_Args
var res clientsBazBaz.SecondService_EchoStringList_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echostringlist(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoStringMapFunc is the handler function for "echoStringMap" method of thrift service "SecondService".
type SecondServiceEchoStringMapFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoStringMap_Args,
) (map[string]*clientsBazBase.BazResponse, map[string]string, error)
// NewSecondServiceEchoStringMapHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoStringMapHandler(f SecondServiceEchoStringMapFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoStringMapHandler{f}
}
// SecondServiceEchoStringMapHandler handles the "echoStringMap" method call of thrift service "SecondService".
type SecondServiceEchoStringMapHandler struct {
echostringmap SecondServiceEchoStringMapFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoStringMapHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoStringMap_Args
var res clientsBazBaz.SecondService_EchoStringMap_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echostringmap(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoStringSetFunc is the handler function for "echoStringSet" method of thrift service "SecondService".
type SecondServiceEchoStringSetFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoStringSet_Args,
) (map[string]struct{}, map[string]string, error)
// NewSecondServiceEchoStringSetHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoStringSetHandler(f SecondServiceEchoStringSetFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoStringSetHandler{f}
}
// SecondServiceEchoStringSetHandler handles the "echoStringSet" method call of thrift service "SecondService".
type SecondServiceEchoStringSetHandler struct {
echostringset SecondServiceEchoStringSetFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoStringSetHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoStringSet_Args
var res clientsBazBaz.SecondService_EchoStringSet_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echostringset(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoStructListFunc is the handler function for "echoStructList" method of thrift service "SecondService".
type SecondServiceEchoStructListFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoStructList_Args,
) ([]*clientsBazBase.BazResponse, map[string]string, error)
// NewSecondServiceEchoStructListHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoStructListHandler(f SecondServiceEchoStructListFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoStructListHandler{f}
}
// SecondServiceEchoStructListHandler handles the "echoStructList" method call of thrift service "SecondService".
type SecondServiceEchoStructListHandler struct {
echostructlist SecondServiceEchoStructListFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoStructListHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoStructList_Args
var res clientsBazBaz.SecondService_EchoStructList_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echostructlist(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoStructSetFunc is the handler function for "echoStructSet" method of thrift service "SecondService".
type SecondServiceEchoStructSetFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoStructSet_Args,
) ([]*clientsBazBase.BazResponse, map[string]string, error)
// NewSecondServiceEchoStructSetHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoStructSetHandler(f SecondServiceEchoStructSetFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoStructSetHandler{f}
}
// SecondServiceEchoStructSetHandler handles the "echoStructSet" method call of thrift service "SecondService".
type SecondServiceEchoStructSetHandler struct {
echostructset SecondServiceEchoStructSetFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoStructSetHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoStructSet_Args
var res clientsBazBaz.SecondService_EchoStructSet_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echostructset(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SecondServiceEchoTypedefFunc is the handler function for "echoTypedef" method of thrift service "SecondService".
type SecondServiceEchoTypedefFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SecondService_EchoTypedef_Args,
) (clientsBazBase.UUID, map[string]string, error)
// NewSecondServiceEchoTypedefHandler wraps a handler function so it can be registered with a thrift server.
func NewSecondServiceEchoTypedefHandler(f SecondServiceEchoTypedefFunc) zanzibar.TChannelHandler {
return &SecondServiceEchoTypedefHandler{f}
}
// SecondServiceEchoTypedefHandler handles the "echoTypedef" method call of thrift service "SecondService".
type SecondServiceEchoTypedefHandler struct {
echotypedef SecondServiceEchoTypedefFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SecondServiceEchoTypedefHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SecondService_EchoTypedef_Args
var res clientsBazBaz.SecondService_EchoTypedef_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.echotypedef(ctx, reqHeaders, &req)
if err != nil {
return false, nil, nil, err
}
res.Success = &r
return err == nil, &res, respHeaders, nil
}
// SimpleServiceCallFunc is the handler function for "call" method of thrift service "SimpleService".
type SimpleServiceCallFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SimpleService_Call_Args,
) (map[string]string, error)
// NewSimpleServiceCallHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceCallHandler(f SimpleServiceCallFunc) zanzibar.TChannelHandler {
return &SimpleServiceCallHandler{f}
}
// SimpleServiceCallHandler handles the "call" method call of thrift service "SimpleService".
type SimpleServiceCallHandler struct {
call SimpleServiceCallFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceCallHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_Call_Args
var res clientsBazBaz.SimpleService_Call_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
respHeaders, err := h.call(ctx, reqHeaders, &req)
if err != nil {
switch v := err.(type) {
case *clientsBazBaz.AuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for call returned non-nil error type *AuthErr but nil value",
)
}
res.AuthErr = v
default:
return false, nil, nil, err
}
}
return err == nil, &res, respHeaders, nil
}
// SimpleServiceCompareFunc is the handler function for "compare" method of thrift service "SimpleService".
type SimpleServiceCompareFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SimpleService_Compare_Args,
) (*clientsBazBase.BazResponse, map[string]string, error)
// NewSimpleServiceCompareHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceCompareHandler(f SimpleServiceCompareFunc) zanzibar.TChannelHandler {
return &SimpleServiceCompareHandler{f}
}
// SimpleServiceCompareHandler handles the "compare" method call of thrift service "SimpleService".
type SimpleServiceCompareHandler struct {
compare SimpleServiceCompareFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceCompareHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_Compare_Args
var res clientsBazBaz.SimpleService_Compare_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.compare(ctx, reqHeaders, &req)
if err != nil {
switch v := err.(type) {
case *clientsBazBaz.AuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for compare returned non-nil error type *AuthErr but nil value",
)
}
res.AuthErr = v
case *clientsBazBaz.OtherAuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for compare returned non-nil error type *OtherAuthErr but nil value",
)
}
res.OtherAuthErr = v
default:
return false, nil, nil, err
}
} else {
res.Success = r
}
return err == nil, &res, respHeaders, nil
}
// SimpleServiceGetProfileFunc is the handler function for "getProfile" method of thrift service "SimpleService".
type SimpleServiceGetProfileFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SimpleService_GetProfile_Args,
) (*clientsBazBaz.GetProfileResponse, map[string]string, error)
// NewSimpleServiceGetProfileHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceGetProfileHandler(f SimpleServiceGetProfileFunc) zanzibar.TChannelHandler {
return &SimpleServiceGetProfileHandler{f}
}
// SimpleServiceGetProfileHandler handles the "getProfile" method call of thrift service "SimpleService".
type SimpleServiceGetProfileHandler struct {
getprofile SimpleServiceGetProfileFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceGetProfileHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_GetProfile_Args
var res clientsBazBaz.SimpleService_GetProfile_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.getprofile(ctx, reqHeaders, &req)
if err != nil {
switch v := err.(type) {
case *clientsBazBaz.AuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for getProfile returned non-nil error type *AuthErr but nil value",
)
}
res.AuthErr = v
default:
return false, nil, nil, err
}
} else {
res.Success = r
}
return err == nil, &res, respHeaders, nil
}
// SimpleServiceHeaderSchemaFunc is the handler function for "headerSchema" method of thrift service "SimpleService".
type SimpleServiceHeaderSchemaFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SimpleService_HeaderSchema_Args,
) (*clientsBazBaz.HeaderSchema, map[string]string, error)
// NewSimpleServiceHeaderSchemaHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceHeaderSchemaHandler(f SimpleServiceHeaderSchemaFunc) zanzibar.TChannelHandler {
return &SimpleServiceHeaderSchemaHandler{f}
}
// SimpleServiceHeaderSchemaHandler handles the "headerSchema" method call of thrift service "SimpleService".
type SimpleServiceHeaderSchemaHandler struct {
headerschema SimpleServiceHeaderSchemaFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceHeaderSchemaHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_HeaderSchema_Args
var res clientsBazBaz.SimpleService_HeaderSchema_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.headerschema(ctx, reqHeaders, &req)
if err != nil {
switch v := err.(type) {
case *clientsBazBaz.AuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for headerSchema returned non-nil error type *AuthErr but nil value",
)
}
res.AuthErr = v
case *clientsBazBaz.OtherAuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for headerSchema returned non-nil error type *OtherAuthErr but nil value",
)
}
res.OtherAuthErr = v
default:
return false, nil, nil, err
}
} else {
res.Success = r
}
return err == nil, &res, respHeaders, nil
}
// SimpleServicePingFunc is the handler function for "ping" method of thrift service "SimpleService".
type SimpleServicePingFunc func(
ctx context.Context,
reqHeaders map[string]string,
) (*clientsBazBase.BazResponse, map[string]string, error)
// NewSimpleServicePingHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServicePingHandler(f SimpleServicePingFunc) zanzibar.TChannelHandler {
return &SimpleServicePingHandler{f}
}
// SimpleServicePingHandler handles the "ping" method call of thrift service "SimpleService".
type SimpleServicePingHandler struct {
ping SimpleServicePingFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServicePingHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_Ping_Args
var res clientsBazBaz.SimpleService_Ping_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.ping(ctx, reqHeaders)
if err != nil {
return false, nil, nil, err
}
res.Success = r
return err == nil, &res, respHeaders, nil
}
// SimpleServiceSillyNoopFunc is the handler function for "sillyNoop" method of thrift service "SimpleService".
type SimpleServiceSillyNoopFunc func(
ctx context.Context,
reqHeaders map[string]string,
) (map[string]string, error)
// NewSimpleServiceSillyNoopHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceSillyNoopHandler(f SimpleServiceSillyNoopFunc) zanzibar.TChannelHandler {
return &SimpleServiceSillyNoopHandler{f}
}
// SimpleServiceSillyNoopHandler handles the "sillyNoop" method call of thrift service "SimpleService".
type SimpleServiceSillyNoopHandler struct {
sillynoop SimpleServiceSillyNoopFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceSillyNoopHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_SillyNoop_Args
var res clientsBazBaz.SimpleService_SillyNoop_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
respHeaders, err := h.sillynoop(ctx, reqHeaders)
if err != nil {
switch v := err.(type) {
case *clientsBazBaz.AuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for sillyNoop returned non-nil error type *AuthErr but nil value",
)
}
res.AuthErr = v
case *clientsBazBase.ServerErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for sillyNoop returned non-nil error type *ServerErr but nil value",
)
}
res.ServerErr = v
default:
return false, nil, nil, err
}
}
return err == nil, &res, respHeaders, nil
}
// SimpleServiceTestUUIDFunc is the handler function for "testUuid" method of thrift service "SimpleService".
type SimpleServiceTestUUIDFunc func(
ctx context.Context,
reqHeaders map[string]string,
) (map[string]string, error)
// NewSimpleServiceTestUUIDHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceTestUUIDHandler(f SimpleServiceTestUUIDFunc) zanzibar.TChannelHandler {
return &SimpleServiceTestUUIDHandler{f}
}
// SimpleServiceTestUUIDHandler handles the "testUuid" method call of thrift service "SimpleService".
type SimpleServiceTestUUIDHandler struct {
testuuid SimpleServiceTestUUIDFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceTestUUIDHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_TestUuid_Args
var res clientsBazBaz.SimpleService_TestUuid_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
respHeaders, err := h.testuuid(ctx, reqHeaders)
if err != nil {
return false, nil, nil, err
}
return err == nil, &res, respHeaders, nil
}
// SimpleServiceTransFunc is the handler function for "trans" method of thrift service "SimpleService".
type SimpleServiceTransFunc func(
ctx context.Context,
reqHeaders map[string]string,
args *clientsBazBaz.SimpleService_Trans_Args,
) (*clientsBazBase.TransStruct, map[string]string, error)
// NewSimpleServiceTransHandler wraps a handler function so it can be registered with a thrift server.
func NewSimpleServiceTransHandler(f SimpleServiceTransFunc) zanzibar.TChannelHandler {
return &SimpleServiceTransHandler{f}
}
// SimpleServiceTransHandler handles the "trans" method call of thrift service "SimpleService".
type SimpleServiceTransHandler struct {
trans SimpleServiceTransFunc
}
// Handle parses request from wire value and calls corresponding handler function.
func (h *SimpleServiceTransHandler) Handle(
ctx context.Context,
reqHeaders map[string]string,
wireValue *wire.Value,
) (bool, zanzibar.RWTStruct, map[string]string, error) {
var req clientsBazBaz.SimpleService_Trans_Args
var res clientsBazBaz.SimpleService_Trans_Result
if err := req.FromWire(*wireValue); err != nil {
return false, nil, nil, err
}
r, respHeaders, err := h.trans(ctx, reqHeaders, &req)
if err != nil {
switch v := err.(type) {
case *clientsBazBaz.AuthErr:
if v == nil {
return false, nil, nil, errors.New(
"Handler for trans returned non-nil error type *AuthErr but nil value",
)