forked from uber/zanzibar
/
withexceptions.go
857 lines (750 loc) · 21.2 KB
/
withexceptions.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
// Code generated by thriftrw v1.20.2. DO NOT EDIT.
// @generated
package withexceptions
import (
errors "errors"
fmt "fmt"
strings "strings"
multierr "go.uber.org/multierr"
wire "go.uber.org/thriftrw/wire"
zapcore "go.uber.org/zap/zapcore"
)
type EndpointExceptionType1 struct {
Message1 string `json:"message1,required"`
}
// ToWire translates a EndpointExceptionType1 struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
// x, err := v.ToWire()
// if err != nil {
// return err
// }
//
// if err := binaryProtocol.Encode(x, writer); err != nil {
// return err
// }
func (v *EndpointExceptionType1) ToWire() (wire.Value, error) {
var (
fields [1]wire.Field
i int = 0
w wire.Value
err error
)
w, err = wire.NewValueString(v.Message1), error(nil)
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 1, Value: w}
i++
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
// FromWire deserializes a EndpointExceptionType1 struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a EndpointExceptionType1 struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v EndpointExceptionType1
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *EndpointExceptionType1) FromWire(w wire.Value) error {
var err error
message1IsSet := false
for _, field := range w.GetStruct().Fields {
switch field.ID {
case 1:
if field.Value.Type() == wire.TBinary {
v.Message1, err = field.Value.GetString(), error(nil)
if err != nil {
return err
}
message1IsSet = true
}
}
}
if !message1IsSet {
return errors.New("field Message1 of EndpointExceptionType1 is required")
}
return nil
}
// String returns a readable string representation of a EndpointExceptionType1
// struct.
func (v *EndpointExceptionType1) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
fields[i] = fmt.Sprintf("Message1: %v", v.Message1)
i++
return fmt.Sprintf("EndpointExceptionType1{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this EndpointExceptionType1 match the
// provided EndpointExceptionType1.
//
// This function performs a deep comparison.
func (v *EndpointExceptionType1) Equals(rhs *EndpointExceptionType1) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !(v.Message1 == rhs.Message1) {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of EndpointExceptionType1.
func (v *EndpointExceptionType1) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
enc.AddString("message1", v.Message1)
return err
}
// GetMessage1 returns the value of Message1 if it is set or its
// zero value if it is unset.
func (v *EndpointExceptionType1) GetMessage1() (o string) {
if v != nil {
o = v.Message1
}
return
}
func (v *EndpointExceptionType1) Error() string {
return v.String()
}
type EndpointExceptionType2 struct {
Message2 string `json:"message2,required"`
}
// ToWire translates a EndpointExceptionType2 struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
// x, err := v.ToWire()
// if err != nil {
// return err
// }
//
// if err := binaryProtocol.Encode(x, writer); err != nil {
// return err
// }
func (v *EndpointExceptionType2) ToWire() (wire.Value, error) {
var (
fields [1]wire.Field
i int = 0
w wire.Value
err error
)
w, err = wire.NewValueString(v.Message2), error(nil)
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 1, Value: w}
i++
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
// FromWire deserializes a EndpointExceptionType2 struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a EndpointExceptionType2 struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v EndpointExceptionType2
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *EndpointExceptionType2) FromWire(w wire.Value) error {
var err error
message2IsSet := false
for _, field := range w.GetStruct().Fields {
switch field.ID {
case 1:
if field.Value.Type() == wire.TBinary {
v.Message2, err = field.Value.GetString(), error(nil)
if err != nil {
return err
}
message2IsSet = true
}
}
}
if !message2IsSet {
return errors.New("field Message2 of EndpointExceptionType2 is required")
}
return nil
}
// String returns a readable string representation of a EndpointExceptionType2
// struct.
func (v *EndpointExceptionType2) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
fields[i] = fmt.Sprintf("Message2: %v", v.Message2)
i++
return fmt.Sprintf("EndpointExceptionType2{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this EndpointExceptionType2 match the
// provided EndpointExceptionType2.
//
// This function performs a deep comparison.
func (v *EndpointExceptionType2) Equals(rhs *EndpointExceptionType2) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !(v.Message2 == rhs.Message2) {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of EndpointExceptionType2.
func (v *EndpointExceptionType2) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
enc.AddString("message2", v.Message2)
return err
}
// GetMessage2 returns the value of Message2 if it is set or its
// zero value if it is unset.
func (v *EndpointExceptionType2) GetMessage2() (o string) {
if v != nil {
o = v.Message2
}
return
}
func (v *EndpointExceptionType2) Error() string {
return v.String()
}
type Response struct {
}
// ToWire translates a Response struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
// x, err := v.ToWire()
// if err != nil {
// return err
// }
//
// if err := binaryProtocol.Encode(x, writer); err != nil {
// return err
// }
func (v *Response) ToWire() (wire.Value, error) {
var (
fields [0]wire.Field
i int = 0
)
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
// FromWire deserializes a Response struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a Response struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v Response
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *Response) FromWire(w wire.Value) error {
for _, field := range w.GetStruct().Fields {
switch field.ID {
}
}
return nil
}
// String returns a readable string representation of a Response
// struct.
func (v *Response) String() string {
if v == nil {
return "<nil>"
}
var fields [0]string
i := 0
return fmt.Sprintf("Response{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this Response match the
// provided Response.
//
// This function performs a deep comparison.
func (v *Response) Equals(rhs *Response) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Response.
func (v *Response) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
return err
}
// WithExceptions_Func1_Args represents the arguments for the WithExceptions.Func1 function.
//
// The arguments for Func1 are sent and received over the wire as this struct.
type WithExceptions_Func1_Args struct {
}
// ToWire translates a WithExceptions_Func1_Args struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
// x, err := v.ToWire()
// if err != nil {
// return err
// }
//
// if err := binaryProtocol.Encode(x, writer); err != nil {
// return err
// }
func (v *WithExceptions_Func1_Args) ToWire() (wire.Value, error) {
var (
fields [0]wire.Field
i int = 0
)
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
// FromWire deserializes a WithExceptions_Func1_Args struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a WithExceptions_Func1_Args struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v WithExceptions_Func1_Args
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *WithExceptions_Func1_Args) FromWire(w wire.Value) error {
for _, field := range w.GetStruct().Fields {
switch field.ID {
}
}
return nil
}
// String returns a readable string representation of a WithExceptions_Func1_Args
// struct.
func (v *WithExceptions_Func1_Args) String() string {
if v == nil {
return "<nil>"
}
var fields [0]string
i := 0
return fmt.Sprintf("WithExceptions_Func1_Args{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this WithExceptions_Func1_Args match the
// provided WithExceptions_Func1_Args.
//
// This function performs a deep comparison.
func (v *WithExceptions_Func1_Args) Equals(rhs *WithExceptions_Func1_Args) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WithExceptions_Func1_Args.
func (v *WithExceptions_Func1_Args) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
return err
}
// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the arguments.
//
// This will always be "Func1" for this struct.
func (v *WithExceptions_Func1_Args) MethodName() string {
return "Func1"
}
// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *WithExceptions_Func1_Args) EnvelopeType() wire.EnvelopeType {
return wire.Call
}
// WithExceptions_Func1_Helper provides functions that aid in handling the
// parameters and return values of the WithExceptions.Func1
// function.
var WithExceptions_Func1_Helper = struct {
// Args accepts the parameters of Func1 in-order and returns
// the arguments struct for the function.
Args func() *WithExceptions_Func1_Args
// IsException returns true if the given error can be thrown
// by Func1.
//
// An error can be thrown by Func1 only if the
// corresponding exception type was mentioned in the 'throws'
// section for it in the Thrift file.
IsException func(error) bool
// WrapResponse returns the result struct for Func1
// given its return value and error.
//
// This allows mapping values and errors returned by
// Func1 into a serializable result struct.
// WrapResponse returns a non-nil error if the provided
// error cannot be thrown by Func1
//
// value, err := Func1(args)
// result, err := WithExceptions_Func1_Helper.WrapResponse(value, err)
// if err != nil {
// return fmt.Errorf("unexpected error from Func1: %v", err)
// }
// serialize(result)
WrapResponse func(*Response, error) (*WithExceptions_Func1_Result, error)
// UnwrapResponse takes the result struct for Func1
// and returns the value or error returned by it.
//
// The error is non-nil only if Func1 threw an
// exception.
//
// result := deserialize(bytes)
// value, err := WithExceptions_Func1_Helper.UnwrapResponse(result)
UnwrapResponse func(*WithExceptions_Func1_Result) (*Response, error)
}{}
func init() {
WithExceptions_Func1_Helper.Args = func() *WithExceptions_Func1_Args {
return &WithExceptions_Func1_Args{}
}
WithExceptions_Func1_Helper.IsException = func(err error) bool {
switch err.(type) {
case *EndpointExceptionType1:
return true
case *EndpointExceptionType2:
return true
default:
return false
}
}
WithExceptions_Func1_Helper.WrapResponse = func(success *Response, err error) (*WithExceptions_Func1_Result, error) {
if err == nil {
return &WithExceptions_Func1_Result{Success: success}, nil
}
switch e := err.(type) {
case *EndpointExceptionType1:
if e == nil {
return nil, errors.New("WrapResponse received non-nil error type with nil value for WithExceptions_Func1_Result.E1")
}
return &WithExceptions_Func1_Result{E1: e}, nil
case *EndpointExceptionType2:
if e == nil {
return nil, errors.New("WrapResponse received non-nil error type with nil value for WithExceptions_Func1_Result.E2")
}
return &WithExceptions_Func1_Result{E2: e}, nil
}
return nil, err
}
WithExceptions_Func1_Helper.UnwrapResponse = func(result *WithExceptions_Func1_Result) (success *Response, err error) {
if result.E1 != nil {
err = result.E1
return
}
if result.E2 != nil {
err = result.E2
return
}
if result.Success != nil {
success = result.Success
return
}
err = errors.New("expected a non-void result")
return
}
}
// WithExceptions_Func1_Result represents the result of a WithExceptions.Func1 function call.
//
// The result of a Func1 execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type WithExceptions_Func1_Result struct {
// Value returned by Func1 after a successful execution.
Success *Response `json:"success,omitempty"`
E1 *EndpointExceptionType1 `json:"e1,omitempty"`
E2 *EndpointExceptionType2 `json:"e2,omitempty"`
}
// ToWire translates a WithExceptions_Func1_Result struct into a Thrift-level intermediate
// representation. This intermediate representation may be serialized
// into bytes using a ThriftRW protocol implementation.
//
// An error is returned if the struct or any of its fields failed to
// validate.
//
// x, err := v.ToWire()
// if err != nil {
// return err
// }
//
// if err := binaryProtocol.Encode(x, writer); err != nil {
// return err
// }
func (v *WithExceptions_Func1_Result) ToWire() (wire.Value, error) {
var (
fields [3]wire.Field
i int = 0
w wire.Value
err error
)
if v.Success != nil {
w, err = v.Success.ToWire()
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 0, Value: w}
i++
}
if v.E1 != nil {
w, err = v.E1.ToWire()
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 1, Value: w}
i++
}
if v.E2 != nil {
w, err = v.E2.ToWire()
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 2, Value: w}
i++
}
if i != 1 {
return wire.Value{}, fmt.Errorf("WithExceptions_Func1_Result should have exactly one field: got %v fields", i)
}
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
func _Response_Read(w wire.Value) (*Response, error) {
var v Response
err := v.FromWire(w)
return &v, err
}
func _EndpointExceptionType1_Read(w wire.Value) (*EndpointExceptionType1, error) {
var v EndpointExceptionType1
err := v.FromWire(w)
return &v, err
}
func _EndpointExceptionType2_Read(w wire.Value) (*EndpointExceptionType2, error) {
var v EndpointExceptionType2
err := v.FromWire(w)
return &v, err
}
// FromWire deserializes a WithExceptions_Func1_Result struct from its Thrift-level
// representation. The Thrift-level representation may be obtained
// from a ThriftRW protocol implementation.
//
// An error is returned if we were unable to build a WithExceptions_Func1_Result struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v WithExceptions_Func1_Result
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *WithExceptions_Func1_Result) FromWire(w wire.Value) error {
var err error
for _, field := range w.GetStruct().Fields {
switch field.ID {
case 0:
if field.Value.Type() == wire.TStruct {
v.Success, err = _Response_Read(field.Value)
if err != nil {
return err
}
}
case 1:
if field.Value.Type() == wire.TStruct {
v.E1, err = _EndpointExceptionType1_Read(field.Value)
if err != nil {
return err
}
}
case 2:
if field.Value.Type() == wire.TStruct {
v.E2, err = _EndpointExceptionType2_Read(field.Value)
if err != nil {
return err
}
}
}
}
count := 0
if v.Success != nil {
count++
}
if v.E1 != nil {
count++
}
if v.E2 != nil {
count++
}
if count != 1 {
return fmt.Errorf("WithExceptions_Func1_Result should have exactly one field: got %v fields", count)
}
return nil
}
// String returns a readable string representation of a WithExceptions_Func1_Result
// struct.
func (v *WithExceptions_Func1_Result) String() string {
if v == nil {
return "<nil>"
}
var fields [3]string
i := 0
if v.Success != nil {
fields[i] = fmt.Sprintf("Success: %v", v.Success)
i++
}
if v.E1 != nil {
fields[i] = fmt.Sprintf("E1: %v", v.E1)
i++
}
if v.E2 != nil {
fields[i] = fmt.Sprintf("E2: %v", v.E2)
i++
}
return fmt.Sprintf("WithExceptions_Func1_Result{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this WithExceptions_Func1_Result match the
// provided WithExceptions_Func1_Result.
//
// This function performs a deep comparison.
func (v *WithExceptions_Func1_Result) Equals(rhs *WithExceptions_Func1_Result) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !((v.Success == nil && rhs.Success == nil) || (v.Success != nil && rhs.Success != nil && v.Success.Equals(rhs.Success))) {
return false
}
if !((v.E1 == nil && rhs.E1 == nil) || (v.E1 != nil && rhs.E1 != nil && v.E1.Equals(rhs.E1))) {
return false
}
if !((v.E2 == nil && rhs.E2 == nil) || (v.E2 != nil && rhs.E2 != nil && v.E2.Equals(rhs.E2))) {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of WithExceptions_Func1_Result.
func (v *WithExceptions_Func1_Result) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
if v.Success != nil {
err = multierr.Append(err, enc.AddObject("success", v.Success))
}
if v.E1 != nil {
err = multierr.Append(err, enc.AddObject("e1", v.E1))
}
if v.E2 != nil {
err = multierr.Append(err, enc.AddObject("e2", v.E2))
}
return err
}
// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *WithExceptions_Func1_Result) GetSuccess() (o *Response) {
if v != nil && v.Success != nil {
return v.Success
}
return
}
// IsSetSuccess returns true if Success is not nil.
func (v *WithExceptions_Func1_Result) IsSetSuccess() bool {
return v != nil && v.Success != nil
}
// GetE1 returns the value of E1 if it is set or its
// zero value if it is unset.
func (v *WithExceptions_Func1_Result) GetE1() (o *EndpointExceptionType1) {
if v != nil && v.E1 != nil {
return v.E1
}
return
}
// IsSetE1 returns true if E1 is not nil.
func (v *WithExceptions_Func1_Result) IsSetE1() bool {
return v != nil && v.E1 != nil
}
// GetE2 returns the value of E2 if it is set or its
// zero value if it is unset.
func (v *WithExceptions_Func1_Result) GetE2() (o *EndpointExceptionType2) {
if v != nil && v.E2 != nil {
return v.E2
}
return
}
// IsSetE2 returns true if E2 is not nil.
func (v *WithExceptions_Func1_Result) IsSetE2() bool {
return v != nil && v.E2 != nil
}
// MethodName returns the name of the Thrift function as specified in
// the IDL, for which this struct represent the result.
//
// This will always be "Func1" for this struct.
func (v *WithExceptions_Func1_Result) MethodName() string {
return "Func1"
}
// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *WithExceptions_Func1_Result) EnvelopeType() wire.EnvelopeType {
return wire.Reply
}