forked from yarpc/yarpc-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
baseservice_healthy.go
144 lines (128 loc) · 3.31 KB
/
baseservice_healthy.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
// Code generated by thriftrw v1.0.0
// @generated
package common
import (
"errors"
"fmt"
"go.uber.org/thriftrw/wire"
"strings"
)
type BaseService_Healthy_Args struct{}
func (v *BaseService_Healthy_Args) ToWire() (wire.Value, error) {
var (
fields [0]wire.Field
i int = 0
)
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
func (v *BaseService_Healthy_Args) FromWire(w wire.Value) error {
for _, field := range w.GetStruct().Fields {
switch field.ID {
}
}
return nil
}
func (v *BaseService_Healthy_Args) String() string {
var fields [0]string
i := 0
return fmt.Sprintf("BaseService_Healthy_Args{%v}", strings.Join(fields[:i], ", "))
}
func (v *BaseService_Healthy_Args) MethodName() string {
return "healthy"
}
func (v *BaseService_Healthy_Args) EnvelopeType() wire.EnvelopeType {
return wire.Call
}
var BaseService_Healthy_Helper = struct {
Args func() *BaseService_Healthy_Args
IsException func(error) bool
WrapResponse func(bool, error) (*BaseService_Healthy_Result, error)
UnwrapResponse func(*BaseService_Healthy_Result) (bool, error)
}{}
func init() {
BaseService_Healthy_Helper.Args = func() *BaseService_Healthy_Args {
return &BaseService_Healthy_Args{}
}
BaseService_Healthy_Helper.IsException = func(err error) bool {
switch err.(type) {
default:
return false
}
}
BaseService_Healthy_Helper.WrapResponse = func(success bool, err error) (*BaseService_Healthy_Result, error) {
if err == nil {
return &BaseService_Healthy_Result{Success: &success}, nil
}
return nil, err
}
BaseService_Healthy_Helper.UnwrapResponse = func(result *BaseService_Healthy_Result) (success bool, err error) {
if result.Success != nil {
success = *result.Success
return
}
err = errors.New("expected a non-void result")
return
}
}
type BaseService_Healthy_Result struct {
Success *bool `json:"success,omitempty"`
}
func (v *BaseService_Healthy_Result) ToWire() (wire.Value, error) {
var (
fields [1]wire.Field
i int = 0
w wire.Value
err error
)
if v.Success != nil {
w, err = wire.NewValueBool(*(v.Success)), error(nil)
if err != nil {
return w, err
}
fields[i] = wire.Field{ID: 0, Value: w}
i++
}
if i != 1 {
return wire.Value{}, fmt.Errorf("BaseService_Healthy_Result should have exactly one field: got %v fields", i)
}
return wire.NewValueStruct(wire.Struct{Fields: fields[:i]}), nil
}
func (v *BaseService_Healthy_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.TBool {
var x bool
x, err = field.Value.GetBool(), error(nil)
v.Success = &x
if err != nil {
return err
}
}
}
}
count := 0
if v.Success != nil {
count++
}
if count != 1 {
return fmt.Errorf("BaseService_Healthy_Result should have exactly one field: got %v fields", count)
}
return nil
}
func (v *BaseService_Healthy_Result) String() string {
var fields [1]string
i := 0
if v.Success != nil {
fields[i] = fmt.Sprintf("Success: %v", *(v.Success))
i++
}
return fmt.Sprintf("BaseService_Healthy_Result{%v}", strings.Join(fields[:i], ", "))
}
func (v *BaseService_Healthy_Result) MethodName() string {
return "healthy"
}
func (v *BaseService_Healthy_Result) EnvelopeType() wire.EnvelopeType {
return wire.Reply
}