-
Notifications
You must be signed in to change notification settings - Fork 829
/
Copy pathhealth.go
830 lines (712 loc) · 20.9 KB
/
health.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
// The MIT License (MIT)
// Copyright (c) 2017-2020 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.
// Code generated by thriftrw v1.32.0. DO NOT EDIT.
// @generated
package health
import (
errors "errors"
fmt "fmt"
strings "strings"
multierr "go.uber.org/multierr"
stream "go.uber.org/thriftrw/protocol/stream"
thriftreflect "go.uber.org/thriftrw/thriftreflect"
wire "go.uber.org/thriftrw/wire"
zapcore "go.uber.org/zap/zapcore"
)
type HealthStatus struct {
Ok bool `json:"ok,required"`
Msg *string `json:"msg,omitempty"`
}
// ToWire translates a HealthStatus 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 *HealthStatus) ToWire() (wire.Value, error) {
var (
fields [2]wire.Field
i int = 0
w wire.Value
err error
)
w, err = wire.NewValueBool(v.Ok), error(nil)
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 1, Value: w}
i++
if v.Msg != nil {
w, err = wire.NewValueString(*(v.Msg)), error(nil)
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 2, Value: w}
i++
}
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
// FromWire deserializes a HealthStatus 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 HealthStatus struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v HealthStatus
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *HealthStatus) FromWire(w wire.Value) error {
var err error
okIsSet := false
for _, field := range w.GetStruct().Fields {
switch field.ID {
case 1:
if field.Value.Type() == wire.TBool {
v.Ok, err = field.Value.GetBool(), error(nil)
if err != nil {
return err
}
okIsSet = true
}
case 2:
if field.Value.Type() == wire.TBinary {
var x string
x, err = field.Value.GetString(), error(nil)
v.Msg = &x
if err != nil {
return err
}
}
}
}
if !okIsSet {
return errors.New("field Ok of HealthStatus is required")
}
return nil
}
// Encode serializes a HealthStatus struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a HealthStatus struct could not be encoded.
func (v *HealthStatus) Encode(sw stream.Writer) error {
if err := sw.WriteStructBegin(); err != nil {
return err
}
if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 1, Type: wire.TBool}); err != nil {
return err
}
if err := sw.WriteBool(v.Ok); err != nil {
return err
}
if err := sw.WriteFieldEnd(); err != nil {
return err
}
if v.Msg != nil {
if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 2, Type: wire.TBinary}); err != nil {
return err
}
if err := sw.WriteString(*(v.Msg)); err != nil {
return err
}
if err := sw.WriteFieldEnd(); err != nil {
return err
}
}
return sw.WriteStructEnd()
}
// Decode deserializes a HealthStatus struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a HealthStatus struct could not be generated from the wire
// representation.
func (v *HealthStatus) Decode(sr stream.Reader) error {
okIsSet := false
if err := sr.ReadStructBegin(); err != nil {
return err
}
fh, ok, err := sr.ReadFieldBegin()
if err != nil {
return err
}
for ok {
switch {
case fh.ID == 1 && fh.Type == wire.TBool:
v.Ok, err = sr.ReadBool()
if err != nil {
return err
}
okIsSet = true
case fh.ID == 2 && fh.Type == wire.TBinary:
var x string
x, err = sr.ReadString()
v.Msg = &x
if err != nil {
return err
}
default:
if err := sr.Skip(fh.Type); err != nil {
return err
}
}
if err := sr.ReadFieldEnd(); err != nil {
return err
}
if fh, ok, err = sr.ReadFieldBegin(); err != nil {
return err
}
}
if err := sr.ReadStructEnd(); err != nil {
return err
}
if !okIsSet {
return errors.New("field Ok of HealthStatus is required")
}
return nil
}
// String returns a readable string representation of a HealthStatus
// struct.
func (v *HealthStatus) String() string {
if v == nil {
return "<nil>"
}
var fields [2]string
i := 0
fields[i] = fmt.Sprintf("Ok: %v", v.Ok)
i++
if v.Msg != nil {
fields[i] = fmt.Sprintf("Msg: %v", *(v.Msg))
i++
}
return fmt.Sprintf("HealthStatus{%v}", strings.Join(fields[:i], ", "))
}
func _String_EqualsPtr(lhs, rhs *string) bool {
if lhs != nil && rhs != nil {
x := *lhs
y := *rhs
return (x == y)
}
return lhs == nil && rhs == nil
}
// Equals returns true if all the fields of this HealthStatus match the
// provided HealthStatus.
//
// This function performs a deep comparison.
func (v *HealthStatus) Equals(rhs *HealthStatus) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
if !(v.Ok == rhs.Ok) {
return false
}
if !_String_EqualsPtr(v.Msg, rhs.Msg) {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of HealthStatus.
func (v *HealthStatus) MarshalLogObject(enc zapcore.ObjectEncoder) (err error) {
if v == nil {
return nil
}
enc.AddBool("ok", v.Ok)
if v.Msg != nil {
enc.AddString("msg", *v.Msg)
}
return err
}
// GetOk returns the value of Ok if it is set or its
// zero value if it is unset.
func (v *HealthStatus) GetOk() (o bool) {
if v != nil {
o = v.Ok
}
return
}
// GetMsg returns the value of Msg if it is set or its
// zero value if it is unset.
func (v *HealthStatus) GetMsg() (o string) {
if v != nil && v.Msg != nil {
return *v.Msg
}
return
}
// IsSetMsg returns true if Msg is not nil.
func (v *HealthStatus) IsSetMsg() bool {
return v != nil && v.Msg != nil
}
// ThriftModule represents the IDL file used to generate this package.
var ThriftModule = &thriftreflect.ThriftModule{
Name: "health",
Package: "github.com/uber/cadence/.gen/go/health",
FilePath: "health.thrift",
SHA1: "8d52f05c157e47bef27c86d2133e1cdb475f8024",
Raw: rawIDL,
}
const rawIDL = "// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\nnamespace java com.uber.cadence\n\n/* ==================== Health Check ==================== */\n\nstruct HealthStatus {\n 1: required bool ok\n 2: optional string msg\n}\n\nservice Meta {\n HealthStatus health()\n}\n\n"
// Meta_Health_Args represents the arguments for the Meta.health function.
//
// The arguments for health are sent and received over the wire as this struct.
type Meta_Health_Args struct {
}
// ToWire translates a Meta_Health_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 *Meta_Health_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 Meta_Health_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 Meta_Health_Args struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v Meta_Health_Args
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *Meta_Health_Args) FromWire(w wire.Value) error {
for _, field := range w.GetStruct().Fields {
switch field.ID {
}
}
return nil
}
// Encode serializes a Meta_Health_Args struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a Meta_Health_Args struct could not be encoded.
func (v *Meta_Health_Args) Encode(sw stream.Writer) error {
if err := sw.WriteStructBegin(); err != nil {
return err
}
return sw.WriteStructEnd()
}
// Decode deserializes a Meta_Health_Args struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a Meta_Health_Args struct could not be generated from the wire
// representation.
func (v *Meta_Health_Args) Decode(sr stream.Reader) error {
if err := sr.ReadStructBegin(); err != nil {
return err
}
fh, ok, err := sr.ReadFieldBegin()
if err != nil {
return err
}
for ok {
switch {
default:
if err := sr.Skip(fh.Type); err != nil {
return err
}
}
if err := sr.ReadFieldEnd(); err != nil {
return err
}
if fh, ok, err = sr.ReadFieldBegin(); err != nil {
return err
}
}
if err := sr.ReadStructEnd(); err != nil {
return err
}
return nil
}
// String returns a readable string representation of a Meta_Health_Args
// struct.
func (v *Meta_Health_Args) String() string {
if v == nil {
return "<nil>"
}
var fields [0]string
i := 0
return fmt.Sprintf("Meta_Health_Args{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this Meta_Health_Args match the
// provided Meta_Health_Args.
//
// This function performs a deep comparison.
func (v *Meta_Health_Args) Equals(rhs *Meta_Health_Args) bool {
if v == nil {
return rhs == nil
} else if rhs == nil {
return false
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Meta_Health_Args.
func (v *Meta_Health_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 "health" for this struct.
func (v *Meta_Health_Args) MethodName() string {
return "health"
}
// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Call for this struct.
func (v *Meta_Health_Args) EnvelopeType() wire.EnvelopeType {
return wire.Call
}
// Meta_Health_Helper provides functions that aid in handling the
// parameters and return values of the Meta.health
// function.
var Meta_Health_Helper = struct {
// Args accepts the parameters of health in-order and returns
// the arguments struct for the function.
Args func() *Meta_Health_Args
// IsException returns true if the given error can be thrown
// by health.
//
// An error can be thrown by health 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 health
// given its return value and error.
//
// This allows mapping values and errors returned by
// health into a serializable result struct.
// WrapResponse returns a non-nil error if the provided
// error cannot be thrown by health
//
// value, err := health(args)
// result, err := Meta_Health_Helper.WrapResponse(value, err)
// if err != nil {
// return fmt.Errorf("unexpected error from health: %v", err)
// }
// serialize(result)
WrapResponse func(*HealthStatus, error) (*Meta_Health_Result, error)
// UnwrapResponse takes the result struct for health
// and returns the value or error returned by it.
//
// The error is non-nil only if health threw an
// exception.
//
// result := deserialize(bytes)
// value, err := Meta_Health_Helper.UnwrapResponse(result)
UnwrapResponse func(*Meta_Health_Result) (*HealthStatus, error)
}{}
func init() {
Meta_Health_Helper.Args = func() *Meta_Health_Args {
return &Meta_Health_Args{}
}
Meta_Health_Helper.IsException = func(err error) bool {
switch err.(type) {
default:
return false
}
}
Meta_Health_Helper.WrapResponse = func(success *HealthStatus, err error) (*Meta_Health_Result, error) {
if err == nil {
return &Meta_Health_Result{Success: success}, nil
}
return nil, err
}
Meta_Health_Helper.UnwrapResponse = func(result *Meta_Health_Result) (success *HealthStatus, err error) {
if result.Success != nil {
success = result.Success
return
}
err = errors.New("expected a non-void result")
return
}
}
// Meta_Health_Result represents the result of a Meta.health function call.
//
// The result of a health execution is sent and received over the wire as this struct.
//
// Success is set only if the function did not throw an exception.
type Meta_Health_Result struct {
// Value returned by health after a successful execution.
Success *HealthStatus `json:"success,omitempty"`
}
// ToWire translates a Meta_Health_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 *Meta_Health_Result) ToWire() (wire.Value, error) {
var (
fields [1]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 i != 1 {
return wire.Value{}, fmt.Errorf("Meta_Health_Result should have exactly one field: got %v fields", i)
}
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
func _HealthStatus_Read(w wire.Value) (*HealthStatus, error) {
var v HealthStatus
err := v.FromWire(w)
return &v, err
}
// FromWire deserializes a Meta_Health_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 Meta_Health_Result struct
// from the provided intermediate representation.
//
// x, err := binaryProtocol.Decode(reader, wire.TStruct)
// if err != nil {
// return nil, err
// }
//
// var v Meta_Health_Result
// if err := v.FromWire(x); err != nil {
// return nil, err
// }
// return &v, nil
func (v *Meta_Health_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 = _HealthStatus_Read(field.Value)
if err != nil {
return err
}
}
}
}
count := 0
if v.Success != nil {
count++
}
if count != 1 {
return fmt.Errorf("Meta_Health_Result should have exactly one field: got %v fields", count)
}
return nil
}
// Encode serializes a Meta_Health_Result struct directly into bytes, without going
// through an intermediary type.
//
// An error is returned if a Meta_Health_Result struct could not be encoded.
func (v *Meta_Health_Result) Encode(sw stream.Writer) error {
if err := sw.WriteStructBegin(); err != nil {
return err
}
if v.Success != nil {
if err := sw.WriteFieldBegin(stream.FieldHeader{ID: 0, Type: wire.TStruct}); err != nil {
return err
}
if err := v.Success.Encode(sw); err != nil {
return err
}
if err := sw.WriteFieldEnd(); err != nil {
return err
}
}
count := 0
if v.Success != nil {
count++
}
if count != 1 {
return fmt.Errorf("Meta_Health_Result should have exactly one field: got %v fields", count)
}
return sw.WriteStructEnd()
}
func _HealthStatus_Decode(sr stream.Reader) (*HealthStatus, error) {
var v HealthStatus
err := v.Decode(sr)
return &v, err
}
// Decode deserializes a Meta_Health_Result struct directly from its Thrift-level
// representation, without going through an intemediary type.
//
// An error is returned if a Meta_Health_Result struct could not be generated from the wire
// representation.
func (v *Meta_Health_Result) Decode(sr stream.Reader) error {
if err := sr.ReadStructBegin(); err != nil {
return err
}
fh, ok, err := sr.ReadFieldBegin()
if err != nil {
return err
}
for ok {
switch {
case fh.ID == 0 && fh.Type == wire.TStruct:
v.Success, err = _HealthStatus_Decode(sr)
if err != nil {
return err
}
default:
if err := sr.Skip(fh.Type); err != nil {
return err
}
}
if err := sr.ReadFieldEnd(); err != nil {
return err
}
if fh, ok, err = sr.ReadFieldBegin(); err != nil {
return err
}
}
if err := sr.ReadStructEnd(); err != nil {
return err
}
count := 0
if v.Success != nil {
count++
}
if count != 1 {
return fmt.Errorf("Meta_Health_Result should have exactly one field: got %v fields", count)
}
return nil
}
// String returns a readable string representation of a Meta_Health_Result
// struct.
func (v *Meta_Health_Result) String() string {
if v == nil {
return "<nil>"
}
var fields [1]string
i := 0
if v.Success != nil {
fields[i] = fmt.Sprintf("Success: %v", v.Success)
i++
}
return fmt.Sprintf("Meta_Health_Result{%v}", strings.Join(fields[:i], ", "))
}
// Equals returns true if all the fields of this Meta_Health_Result match the
// provided Meta_Health_Result.
//
// This function performs a deep comparison.
func (v *Meta_Health_Result) Equals(rhs *Meta_Health_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
}
return true
}
// MarshalLogObject implements zapcore.ObjectMarshaler, enabling
// fast logging of Meta_Health_Result.
func (v *Meta_Health_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))
}
return err
}
// GetSuccess returns the value of Success if it is set or its
// zero value if it is unset.
func (v *Meta_Health_Result) GetSuccess() (o *HealthStatus) {
if v != nil && v.Success != nil {
return v.Success
}
return
}
// IsSetSuccess returns true if Success is not nil.
func (v *Meta_Health_Result) IsSetSuccess() bool {
return v != nil && v.Success != 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 "health" for this struct.
func (v *Meta_Health_Result) MethodName() string {
return "health"
}
// EnvelopeType returns the kind of value inside this struct.
//
// This will always be Reply for this struct.
func (v *Meta_Health_Result) EnvelopeType() wire.EnvelopeType {
return wire.Reply
}