1// Code generated by protoc-gen-validate. DO NOT EDIT.
2// source: envoy/admin/v3/server_info.proto
3
4package envoy_admin_v3
5
6import (
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// ensure the imports are used
22var (
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// Validate checks the field values on ServerInfo with the rules defined in the
37// proto definition for this message. If any rules are violated, an error is returned.
38func (m *ServerInfo) Validate() error {
39	if m == nil {
40		return nil
41	}
42
43	// no validation rules for Version
44
45	// no validation rules for State
46
47	if v, ok := interface{}(m.GetUptimeCurrentEpoch()).(interface{ Validate() error }); ok {
48		if err := v.Validate(); err != nil {
49			return ServerInfoValidationError{
50				field:  "UptimeCurrentEpoch",
51				reason: "embedded message failed validation",
52				cause:  err,
53			}
54		}
55	}
56
57	if v, ok := interface{}(m.GetUptimeAllEpochs()).(interface{ Validate() error }); ok {
58		if err := v.Validate(); err != nil {
59			return ServerInfoValidationError{
60				field:  "UptimeAllEpochs",
61				reason: "embedded message failed validation",
62				cause:  err,
63			}
64		}
65	}
66
67	// no validation rules for HotRestartVersion
68
69	if v, ok := interface{}(m.GetCommandLineOptions()).(interface{ Validate() error }); ok {
70		if err := v.Validate(); err != nil {
71			return ServerInfoValidationError{
72				field:  "CommandLineOptions",
73				reason: "embedded message failed validation",
74				cause:  err,
75			}
76		}
77	}
78
79	if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
80		if err := v.Validate(); err != nil {
81			return ServerInfoValidationError{
82				field:  "Node",
83				reason: "embedded message failed validation",
84				cause:  err,
85			}
86		}
87	}
88
89	return nil
90}
91
92// ServerInfoValidationError is the validation error returned by
93// ServerInfo.Validate if the designated constraints aren't met.
94type ServerInfoValidationError struct {
95	field  string
96	reason string
97	cause  error
98	key    bool
99}
100
101// Field function returns field value.
102func (e ServerInfoValidationError) Field() string { return e.field }
103
104// Reason function returns reason value.
105func (e ServerInfoValidationError) Reason() string { return e.reason }
106
107// Cause function returns cause value.
108func (e ServerInfoValidationError) Cause() error { return e.cause }
109
110// Key function returns key value.
111func (e ServerInfoValidationError) Key() bool { return e.key }
112
113// ErrorName returns error name.
114func (e ServerInfoValidationError) ErrorName() string { return "ServerInfoValidationError" }
115
116// Error satisfies the builtin error interface
117func (e ServerInfoValidationError) Error() string {
118	cause := ""
119	if e.cause != nil {
120		cause = fmt.Sprintf(" | caused by: %v", e.cause)
121	}
122
123	key := ""
124	if e.key {
125		key = "key for "
126	}
127
128	return fmt.Sprintf(
129		"invalid %sServerInfo.%s: %s%s",
130		key,
131		e.field,
132		e.reason,
133		cause)
134}
135
136var _ error = ServerInfoValidationError{}
137
138var _ interface {
139	Field() string
140	Reason() string
141	Key() bool
142	Cause() error
143	ErrorName() string
144} = ServerInfoValidationError{}
145
146// Validate checks the field values on CommandLineOptions with the rules
147// defined in the proto definition for this message. If any rules are
148// violated, an error is returned.
149func (m *CommandLineOptions) Validate() error {
150	if m == nil {
151		return nil
152	}
153
154	// no validation rules for BaseId
155
156	// no validation rules for UseDynamicBaseId
157
158	// no validation rules for BaseIdPath
159
160	// no validation rules for Concurrency
161
162	// no validation rules for ConfigPath
163
164	// no validation rules for ConfigYaml
165
166	// no validation rules for AllowUnknownStaticFields
167
168	// no validation rules for RejectUnknownDynamicFields
169
170	// no validation rules for IgnoreUnknownDynamicFields
171
172	// no validation rules for AdminAddressPath
173
174	// no validation rules for LocalAddressIpVersion
175
176	// no validation rules for LogLevel
177
178	// no validation rules for ComponentLogLevel
179
180	// no validation rules for LogFormat
181
182	// no validation rules for LogFormatEscaped
183
184	// no validation rules for LogPath
185
186	// no validation rules for ServiceCluster
187
188	// no validation rules for ServiceNode
189
190	// no validation rules for ServiceZone
191
192	if v, ok := interface{}(m.GetFileFlushInterval()).(interface{ Validate() error }); ok {
193		if err := v.Validate(); err != nil {
194			return CommandLineOptionsValidationError{
195				field:  "FileFlushInterval",
196				reason: "embedded message failed validation",
197				cause:  err,
198			}
199		}
200	}
201
202	if v, ok := interface{}(m.GetDrainTime()).(interface{ Validate() error }); ok {
203		if err := v.Validate(); err != nil {
204			return CommandLineOptionsValidationError{
205				field:  "DrainTime",
206				reason: "embedded message failed validation",
207				cause:  err,
208			}
209		}
210	}
211
212	// no validation rules for DrainStrategy
213
214	if v, ok := interface{}(m.GetParentShutdownTime()).(interface{ Validate() error }); ok {
215		if err := v.Validate(); err != nil {
216			return CommandLineOptionsValidationError{
217				field:  "ParentShutdownTime",
218				reason: "embedded message failed validation",
219				cause:  err,
220			}
221		}
222	}
223
224	// no validation rules for Mode
225
226	// no validation rules for DisableHotRestart
227
228	// no validation rules for EnableMutexTracing
229
230	// no validation rules for RestartEpoch
231
232	// no validation rules for CpusetThreads
233
234	// no validation rules for BootstrapVersion
235
236	// no validation rules for EnableFineGrainLogging
237
238	// no validation rules for SocketPath
239
240	// no validation rules for SocketMode
241
242	// no validation rules for EnableCoreDump
243
244	// no validation rules for HiddenEnvoyDeprecatedMaxStats
245
246	// no validation rules for HiddenEnvoyDeprecatedMaxObjNameLen
247
248	return nil
249}
250
251// CommandLineOptionsValidationError is the validation error returned by
252// CommandLineOptions.Validate if the designated constraints aren't met.
253type CommandLineOptionsValidationError struct {
254	field  string
255	reason string
256	cause  error
257	key    bool
258}
259
260// Field function returns field value.
261func (e CommandLineOptionsValidationError) Field() string { return e.field }
262
263// Reason function returns reason value.
264func (e CommandLineOptionsValidationError) Reason() string { return e.reason }
265
266// Cause function returns cause value.
267func (e CommandLineOptionsValidationError) Cause() error { return e.cause }
268
269// Key function returns key value.
270func (e CommandLineOptionsValidationError) Key() bool { return e.key }
271
272// ErrorName returns error name.
273func (e CommandLineOptionsValidationError) ErrorName() string {
274	return "CommandLineOptionsValidationError"
275}
276
277// Error satisfies the builtin error interface
278func (e CommandLineOptionsValidationError) Error() string {
279	cause := ""
280	if e.cause != nil {
281		cause = fmt.Sprintf(" | caused by: %v", e.cause)
282	}
283
284	key := ""
285	if e.key {
286		key = "key for "
287	}
288
289	return fmt.Sprintf(
290		"invalid %sCommandLineOptions.%s: %s%s",
291		key,
292		e.field,
293		e.reason,
294		cause)
295}
296
297var _ error = CommandLineOptionsValidationError{}
298
299var _ interface {
300	Field() string
301	Reason() string
302	Key() bool
303	Cause() error
304	ErrorName() string
305} = CommandLineOptionsValidationError{}
306