...
1
2
3
4 package envoy_service_load_stats_v4alpha
5
6 import (
7 "bytes"
8 "errors"
9 "fmt"
10 "net"
11 "net/mail"
12 "net/url"
13 "regexp"
14 "strings"
15 "time"
16 "unicode/utf8"
17
18 "github.com/golang/protobuf/ptypes"
19 )
20
21
22 var (
23 _ = bytes.MinRead
24 _ = errors.New("")
25 _ = fmt.Print
26 _ = utf8.UTFMax
27 _ = (*regexp.Regexp)(nil)
28 _ = (*strings.Reader)(nil)
29 _ = net.IPv4len
30 _ = time.Duration(0)
31 _ = (*url.URL)(nil)
32 _ = (*mail.Address)(nil)
33 _ = ptypes.DynamicAny{}
34 )
35
36
37
38
39 func (m *LoadStatsRequest) Validate() error {
40 if m == nil {
41 return nil
42 }
43
44 if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
45 if err := v.Validate(); err != nil {
46 return LoadStatsRequestValidationError{
47 field: "Node",
48 reason: "embedded message failed validation",
49 cause: err,
50 }
51 }
52 }
53
54 for idx, item := range m.GetClusterStats() {
55 _, _ = idx, item
56
57 if v, ok := interface{}(item).(interface{ Validate() error }); ok {
58 if err := v.Validate(); err != nil {
59 return LoadStatsRequestValidationError{
60 field: fmt.Sprintf("ClusterStats[%v]", idx),
61 reason: "embedded message failed validation",
62 cause: err,
63 }
64 }
65 }
66
67 }
68
69 return nil
70 }
71
72
73
74 type LoadStatsRequestValidationError struct {
75 field string
76 reason string
77 cause error
78 key bool
79 }
80
81
82 func (e LoadStatsRequestValidationError) Field() string { return e.field }
83
84
85 func (e LoadStatsRequestValidationError) Reason() string { return e.reason }
86
87
88 func (e LoadStatsRequestValidationError) Cause() error { return e.cause }
89
90
91 func (e LoadStatsRequestValidationError) Key() bool { return e.key }
92
93
94 func (e LoadStatsRequestValidationError) ErrorName() string { return "LoadStatsRequestValidationError" }
95
96
97 func (e LoadStatsRequestValidationError) Error() string {
98 cause := ""
99 if e.cause != nil {
100 cause = fmt.Sprintf(" | caused by: %v", e.cause)
101 }
102
103 key := ""
104 if e.key {
105 key = "key for "
106 }
107
108 return fmt.Sprintf(
109 "invalid %sLoadStatsRequest.%s: %s%s",
110 key,
111 e.field,
112 e.reason,
113 cause)
114 }
115
116 var _ error = LoadStatsRequestValidationError{}
117
118 var _ interface {
119 Field() string
120 Reason() string
121 Key() bool
122 Cause() error
123 ErrorName() string
124 } = LoadStatsRequestValidationError{}
125
126
127
128
129 func (m *LoadStatsResponse) Validate() error {
130 if m == nil {
131 return nil
132 }
133
134
135
136 if v, ok := interface{}(m.GetLoadReportingInterval()).(interface{ Validate() error }); ok {
137 if err := v.Validate(); err != nil {
138 return LoadStatsResponseValidationError{
139 field: "LoadReportingInterval",
140 reason: "embedded message failed validation",
141 cause: err,
142 }
143 }
144 }
145
146
147
148 return nil
149 }
150
151
152
153 type LoadStatsResponseValidationError struct {
154 field string
155 reason string
156 cause error
157 key bool
158 }
159
160
161 func (e LoadStatsResponseValidationError) Field() string { return e.field }
162
163
164 func (e LoadStatsResponseValidationError) Reason() string { return e.reason }
165
166
167 func (e LoadStatsResponseValidationError) Cause() error { return e.cause }
168
169
170 func (e LoadStatsResponseValidationError) Key() bool { return e.key }
171
172
173 func (e LoadStatsResponseValidationError) ErrorName() string {
174 return "LoadStatsResponseValidationError"
175 }
176
177
178 func (e LoadStatsResponseValidationError) Error() string {
179 cause := ""
180 if e.cause != nil {
181 cause = fmt.Sprintf(" | caused by: %v", e.cause)
182 }
183
184 key := ""
185 if e.key {
186 key = "key for "
187 }
188
189 return fmt.Sprintf(
190 "invalid %sLoadStatsResponse.%s: %s%s",
191 key,
192 e.field,
193 e.reason,
194 cause)
195 }
196
197 var _ error = LoadStatsResponseValidationError{}
198
199 var _ interface {
200 Field() string
201 Reason() string
202 Key() bool
203 Cause() error
204 ErrorName() string
205 } = LoadStatsResponseValidationError{}
206
View as plain text