id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
listlengths
21
1.41k
docstring
stringlengths
6
2.61k
docstring_tokens
listlengths
3
215
sha
stringlengths
40
40
url
stringlengths
85
252
147,000
envoyproxy/go-control-plane
envoy/api/v2/auth/cert.pb.validate.go
Validate
func (m *SdsSecretConfig) Validate() error { if m == nil { return nil } // no validation rules for Name { tmp := m.GetSdsConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SdsSecretConfigValidationError{ field: "SdsConfig", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *SdsSecretConfig) Validate() error { if m == nil { return nil } // no validation rules for Name { tmp := m.GetSdsConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SdsSecretConfigValidationError{ field: "SdsConfig", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "SdsSecretConfig", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Name", "{", "tmp", ":=", "m", ".", "GetSdsConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "SdsSecretConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on SdsSecretConfig with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "SdsSecretConfig", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/auth/cert.pb.validate.go#L949-L972
147,001
envoyproxy/go-control-plane
envoy/api/v2/auth/cert.pb.validate.go
Validate
func (m *Secret) Validate() error { if m == nil { return nil } // no validation rules for Name switch m.Type.(type) { case *Secret_TlsCertificate: { tmp := m.GetTlsCertificate() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretValidationError{ field: "TlsCertificate", reason: "embedded message failed validation", cause: err, } } } } case *Secret_SessionTicketKeys: { tmp := m.GetSessionTicketKeys() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretValidationError{ field: "SessionTicketKeys", reason: "embedded message failed validation", cause: err, } } } } case *Secret_ValidationContext: { tmp := m.GetValidationContext() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretValidationError{ field: "ValidationContext", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *Secret) Validate() error { if m == nil { return nil } // no validation rules for Name switch m.Type.(type) { case *Secret_TlsCertificate: { tmp := m.GetTlsCertificate() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretValidationError{ field: "TlsCertificate", reason: "embedded message failed validation", cause: err, } } } } case *Secret_SessionTicketKeys: { tmp := m.GetSessionTicketKeys() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretValidationError{ field: "SessionTicketKeys", reason: "embedded message failed validation", cause: err, } } } } case *Secret_ValidationContext: { tmp := m.GetValidationContext() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return SecretValidationError{ field: "ValidationContext", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "Secret", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Name", "switch", "m", ".", "Type", ".", "(", "type", ")", "{", "case", "*", "Secret_TlsCertificate", ":", "{", "tmp", ":=", "m", ".", "GetTlsCertificate", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "SecretValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "Secret_SessionTicketKeys", ":", "{", "tmp", ":=", "m", ".", "GetSessionTicketKeys", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "SecretValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "Secret_ValidationContext", ":", "{", "tmp", ":=", "m", ".", "GetValidationContext", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "SecretValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Secret with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Secret", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/auth/cert.pb.validate.go#L1030-L1093
147,002
envoyproxy/go-control-plane
envoy/api/v2/auth/cert.pb.validate.go
Validate
func (m *CommonTlsContext_CombinedCertificateValidationContext) Validate() error { if m == nil { return nil } if m.GetDefaultValidationContext() == nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "DefaultValidationContext", reason: "value is required", } } { tmp := m.GetDefaultValidationContext() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "DefaultValidationContext", reason: "embedded message failed validation", cause: err, } } } } if m.GetValidationContextSdsSecretConfig() == nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "ValidationContextSdsSecretConfig", reason: "value is required", } } { tmp := m.GetValidationContextSdsSecretConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "ValidationContextSdsSecretConfig", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *CommonTlsContext_CombinedCertificateValidationContext) Validate() error { if m == nil { return nil } if m.GetDefaultValidationContext() == nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "DefaultValidationContext", reason: "value is required", } } { tmp := m.GetDefaultValidationContext() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "DefaultValidationContext", reason: "embedded message failed validation", cause: err, } } } } if m.GetValidationContextSdsSecretConfig() == nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "ValidationContextSdsSecretConfig", reason: "value is required", } } { tmp := m.GetValidationContextSdsSecretConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonTlsContext_CombinedCertificateValidationContextValidationError{ field: "ValidationContextSdsSecretConfig", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "CommonTlsContext_CombinedCertificateValidationContext", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetDefaultValidationContext", "(", ")", "==", "nil", "{", "return", "CommonTlsContext_CombinedCertificateValidationContextValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetDefaultValidationContext", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CommonTlsContext_CombinedCertificateValidationContextValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "if", "m", ".", "GetValidationContextSdsSecretConfig", "(", ")", "==", "nil", "{", "return", "CommonTlsContext_CombinedCertificateValidationContextValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetValidationContextSdsSecretConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CommonTlsContext_CombinedCertificateValidationContextValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on // CommonTlsContext_CombinedCertificateValidationContext with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "CommonTlsContext_CombinedCertificateValidationContext", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/auth/cert.pb.validate.go#L1153-L1203
147,003
envoyproxy/go-control-plane
envoy/config/filter/http/csrf/v2/csrf.pb.validate.go
Validate
func (m *CsrfPolicy) Validate() error { if m == nil { return nil } if m.GetFilterEnabled() == nil { return CsrfPolicyValidationError{ field: "FilterEnabled", reason: "value is required", } } { tmp := m.GetFilterEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CsrfPolicyValidationError{ field: "FilterEnabled", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetShadowEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CsrfPolicyValidationError{ field: "ShadowEnabled", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *CsrfPolicy) Validate() error { if m == nil { return nil } if m.GetFilterEnabled() == nil { return CsrfPolicyValidationError{ field: "FilterEnabled", reason: "value is required", } } { tmp := m.GetFilterEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CsrfPolicyValidationError{ field: "FilterEnabled", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetShadowEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CsrfPolicyValidationError{ field: "ShadowEnabled", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "CsrfPolicy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetFilterEnabled", "(", ")", "==", "nil", "{", "return", "CsrfPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetFilterEnabled", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CsrfPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetShadowEnabled", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CsrfPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on CsrfPolicy with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "CsrfPolicy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/csrf/v2/csrf.pb.validate.go#L38-L81
147,004
envoyproxy/go-control-plane
envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.validate.go
Validate
func (m *InjectedResourceConfig) Validate() error { if m == nil { return nil } if len(m.GetFilename()) < 1 { return InjectedResourceConfigValidationError{ field: "Filename", reason: "value length must be at least 1 bytes", } } return nil }
go
func (m *InjectedResourceConfig) Validate() error { if m == nil { return nil } if len(m.GetFilename()) < 1 { return InjectedResourceConfigValidationError{ field: "Filename", reason: "value length must be at least 1 bytes", } } return nil }
[ "func", "(", "m", "*", "InjectedResourceConfig", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetFilename", "(", ")", ")", "<", "1", "{", "return", "InjectedResourceConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on InjectedResourceConfig with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "InjectedResourceConfig", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/resource_monitor/injected_resource/v2alpha/injected_resource.pb.validate.go#L39-L52
147,005
envoyproxy/go-control-plane
envoy/api/v2/listener/listener.pb.validate.go
Validate
func (m *Filter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return FilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *Filter_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *Filter_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *Filter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return FilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *Filter_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *Filter_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "Filter", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "FilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "ConfigType", ".", "(", "type", ")", "{", "case", "*", "Filter_Config", ":", "{", "tmp", ":=", "m", ".", "GetConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "Filter_TypedConfig", ":", "{", "tmp", ":=", "m", ".", "GetTypedConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Filter with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Filter", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/listener/listener.pb.validate.go#L38-L89
147,006
envoyproxy/go-control-plane
envoy/api/v2/listener/listener.pb.validate.go
Validate
func (m *FilterChainMatch) Validate() error { if m == nil { return nil } if wrapper := m.GetDestinationPort(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 65535 { return FilterChainMatchValidationError{ field: "DestinationPort", reason: "value must be inside range [1, 65535]", } } } for idx, item := range m.GetPrefixRanges() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: fmt.Sprintf("PrefixRanges[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for AddressSuffix { tmp := m.GetSuffixLen() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: "SuffixLen", reason: "embedded message failed validation", cause: err, } } } } if _, ok := FilterChainMatch_ConnectionSourceType_name[int32(m.GetSourceType())]; !ok { return FilterChainMatchValidationError{ field: "SourceType", reason: "value must be one of the defined enum values", } } for idx, item := range m.GetSourcePrefixRanges() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: fmt.Sprintf("SourcePrefixRanges[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetSourcePorts() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: fmt.Sprintf("SourcePorts[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for TransportProtocol return nil }
go
func (m *FilterChainMatch) Validate() error { if m == nil { return nil } if wrapper := m.GetDestinationPort(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 65535 { return FilterChainMatchValidationError{ field: "DestinationPort", reason: "value must be inside range [1, 65535]", } } } for idx, item := range m.GetPrefixRanges() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: fmt.Sprintf("PrefixRanges[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for AddressSuffix { tmp := m.GetSuffixLen() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: "SuffixLen", reason: "embedded message failed validation", cause: err, } } } } if _, ok := FilterChainMatch_ConnectionSourceType_name[int32(m.GetSourceType())]; !ok { return FilterChainMatchValidationError{ field: "SourceType", reason: "value must be one of the defined enum values", } } for idx, item := range m.GetSourcePrefixRanges() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: fmt.Sprintf("SourcePrefixRanges[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetSourcePorts() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainMatchValidationError{ field: fmt.Sprintf("SourcePorts[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for TransportProtocol return nil }
[ "func", "(", "m", "*", "FilterChainMatch", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetDestinationPort", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "1", "||", "val", ">", "65535", "{", "return", "FilterChainMatchValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetPrefixRanges", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainMatchValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for AddressSuffix", "{", "tmp", ":=", "m", ".", "GetSuffixLen", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainMatchValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "FilterChainMatch_ConnectionSourceType_name", "[", "int32", "(", "m", ".", "GetSourceType", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "FilterChainMatchValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetSourcePrefixRanges", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainMatchValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetSourcePorts", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainMatchValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for TransportProtocol", "return", "nil", "\n", "}" ]
// Validate checks the field values on FilterChainMatch with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FilterChainMatch", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/listener/listener.pb.validate.go#L148-L251
147,007
envoyproxy/go-control-plane
envoy/api/v2/listener/listener.pb.validate.go
Validate
func (m *FilterChain) Validate() error { if m == nil { return nil } { tmp := m.GetFilterChainMatch() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "FilterChainMatch", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetTlsContext() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "TlsContext", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetFilters() { _, _ = idx, item { tmp := item if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: fmt.Sprintf("Filters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetUseProxyProto() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "UseProxyProto", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetTransportSocket() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "TransportSocket", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *FilterChain) Validate() error { if m == nil { return nil } { tmp := m.GetFilterChainMatch() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "FilterChainMatch", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetTlsContext() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "TlsContext", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetFilters() { _, _ = idx, item { tmp := item if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: fmt.Sprintf("Filters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetUseProxyProto() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "UseProxyProto", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetTransportSocket() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FilterChainValidationError{ field: "TransportSocket", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "FilterChain", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetFilterChainMatch", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetTlsContext", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetFilters", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "&", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetUseProxyProto", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMetadata", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetTransportSocket", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FilterChainValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on FilterChain with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FilterChain", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/listener/listener.pb.validate.go#L310-L411
147,008
envoyproxy/go-control-plane
envoy/api/v2/listener/listener.pb.validate.go
Validate
func (m *ListenerFilter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return ListenerFilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *ListenerFilter_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListenerFilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *ListenerFilter_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListenerFilterValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *ListenerFilter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return ListenerFilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *ListenerFilter_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListenerFilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *ListenerFilter_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ListenerFilterValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "ListenerFilter", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "ListenerFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "ConfigType", ".", "(", "type", ")", "{", "case", "*", "ListenerFilter_Config", ":", "{", "tmp", ":=", "m", ".", "GetConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ListenerFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "ListenerFilter_TypedConfig", ":", "{", "tmp", ":=", "m", ".", "GetTypedConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ListenerFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ListenerFilter with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ListenerFilter", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/listener/listener.pb.validate.go#L470-L521
147,009
envoyproxy/go-control-plane
envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go
Validate
func (m *TcpProxy_DeprecatedV1) Validate() error { if m == nil { return nil } if len(m.GetRoutes()) < 1 { return TcpProxy_DeprecatedV1ValidationError{ field: "Routes", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetRoutes() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_DeprecatedV1ValidationError{ field: fmt.Sprintf("Routes[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *TcpProxy_DeprecatedV1) Validate() error { if m == nil { return nil } if len(m.GetRoutes()) < 1 { return TcpProxy_DeprecatedV1ValidationError{ field: "Routes", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetRoutes() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_DeprecatedV1ValidationError{ field: fmt.Sprintf("Routes[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "TcpProxy_DeprecatedV1", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetRoutes", "(", ")", ")", "<", "1", "{", "return", "TcpProxy_DeprecatedV1ValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRoutes", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "TcpProxy_DeprecatedV1ValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on TcpProxy_DeprecatedV1 with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "TcpProxy_DeprecatedV1", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go#L245-L278
147,010
envoyproxy/go-control-plane
envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go
Validate
func (m *TcpProxy_WeightedCluster) Validate() error { if m == nil { return nil } if len(m.GetClusters()) < 1 { return TcpProxy_WeightedClusterValidationError{ field: "Clusters", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetClusters() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_WeightedClusterValidationError{ field: fmt.Sprintf("Clusters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *TcpProxy_WeightedCluster) Validate() error { if m == nil { return nil } if len(m.GetClusters()) < 1 { return TcpProxy_WeightedClusterValidationError{ field: "Clusters", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetClusters() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_WeightedClusterValidationError{ field: fmt.Sprintf("Clusters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "TcpProxy_WeightedCluster", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetClusters", "(", ")", ")", "<", "1", "{", "return", "TcpProxy_WeightedClusterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetClusters", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "TcpProxy_WeightedClusterValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on TcpProxy_WeightedCluster with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "TcpProxy_WeightedCluster", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go#L339-L372
147,011
envoyproxy/go-control-plane
envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go
Validate
func (m *TcpProxy_DeprecatedV1_TCPRoute) Validate() error { if m == nil { return nil } if len(m.GetCluster()) < 1 { return TcpProxy_DeprecatedV1_TCPRouteValidationError{ field: "Cluster", reason: "value length must be at least 1 bytes", } } for idx, item := range m.GetDestinationIpList() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_DeprecatedV1_TCPRouteValidationError{ field: fmt.Sprintf("DestinationIpList[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for DestinationPorts for idx, item := range m.GetSourceIpList() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_DeprecatedV1_TCPRouteValidationError{ field: fmt.Sprintf("SourceIpList[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for SourcePorts return nil }
go
func (m *TcpProxy_DeprecatedV1_TCPRoute) Validate() error { if m == nil { return nil } if len(m.GetCluster()) < 1 { return TcpProxy_DeprecatedV1_TCPRouteValidationError{ field: "Cluster", reason: "value length must be at least 1 bytes", } } for idx, item := range m.GetDestinationIpList() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_DeprecatedV1_TCPRouteValidationError{ field: fmt.Sprintf("DestinationIpList[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for DestinationPorts for idx, item := range m.GetSourceIpList() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TcpProxy_DeprecatedV1_TCPRouteValidationError{ field: fmt.Sprintf("SourceIpList[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for SourcePorts return nil }
[ "func", "(", "m", "*", "TcpProxy_DeprecatedV1_TCPRoute", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetCluster", "(", ")", ")", "<", "1", "{", "return", "TcpProxy_DeprecatedV1_TCPRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetDestinationIpList", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "TcpProxy_DeprecatedV1_TCPRouteValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for DestinationPorts", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetSourceIpList", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "TcpProxy_DeprecatedV1_TCPRouteValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for SourcePorts", "return", "nil", "\n", "}" ]
// Validate checks the field values on TcpProxy_DeprecatedV1_TCPRoute with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "TcpProxy_DeprecatedV1_TCPRoute", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go#L433-L490
147,012
envoyproxy/go-control-plane
envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go
Validate
func (m *TcpProxy_WeightedCluster_ClusterWeight) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return TcpProxy_WeightedCluster_ClusterWeightValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } if m.GetWeight() < 1 { return TcpProxy_WeightedCluster_ClusterWeightValidationError{ field: "Weight", reason: "value must be greater than or equal to 1", } } return nil }
go
func (m *TcpProxy_WeightedCluster_ClusterWeight) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return TcpProxy_WeightedCluster_ClusterWeightValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } if m.GetWeight() < 1 { return TcpProxy_WeightedCluster_ClusterWeightValidationError{ field: "Weight", reason: "value must be greater than or equal to 1", } } return nil }
[ "func", "(", "m", "*", "TcpProxy_WeightedCluster_ClusterWeight", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "TcpProxy_WeightedCluster_ClusterWeightValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "m", ".", "GetWeight", "(", ")", "<", "1", "{", "return", "TcpProxy_WeightedCluster_ClusterWeightValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on TcpProxy_WeightedCluster_ClusterWeight // with the rules defined in the proto definition for this message. If any // rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "TcpProxy_WeightedCluster_ClusterWeight", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/tcp_proxy/v2/tcp_proxy.pb.validate.go#L552-L572
147,013
envoyproxy/go-control-plane
envoy/config/filter/network/dubbo_proxy/v2alpha1/route.pb.validate.go
Validate
func (m *MethodMatch) Validate() error { if m == nil { return nil } { tmp := m.GetName() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MethodMatchValidationError{ field: "Name", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for ParamsMatch return nil }
go
func (m *MethodMatch) Validate() error { if m == nil { return nil } { tmp := m.GetName() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MethodMatchValidationError{ field: "Name", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for ParamsMatch return nil }
[ "func", "(", "m", "*", "MethodMatch", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetName", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "MethodMatchValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for ParamsMatch", "return", "nil", "\n", "}" ]
// Validate checks the field values on MethodMatch with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "MethodMatch", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/dubbo_proxy/v2alpha1/route.pb.validate.go#L422-L445
147,014
envoyproxy/go-control-plane
envoy/config/filter/network/dubbo_proxy/v2alpha1/route.pb.validate.go
Validate
func (m *MethodMatch_ParameterMatchSpecifier) Validate() error { if m == nil { return nil } switch m.ParameterMatchSpecifier.(type) { case *MethodMatch_ParameterMatchSpecifier_ExactMatch: // no validation rules for ExactMatch case *MethodMatch_ParameterMatchSpecifier_RangeMatch: { tmp := m.GetRangeMatch() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MethodMatch_ParameterMatchSpecifierValidationError{ field: "RangeMatch", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *MethodMatch_ParameterMatchSpecifier) Validate() error { if m == nil { return nil } switch m.ParameterMatchSpecifier.(type) { case *MethodMatch_ParameterMatchSpecifier_ExactMatch: // no validation rules for ExactMatch case *MethodMatch_ParameterMatchSpecifier_RangeMatch: { tmp := m.GetRangeMatch() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MethodMatch_ParameterMatchSpecifierValidationError{ field: "RangeMatch", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "MethodMatch_ParameterMatchSpecifier", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "ParameterMatchSpecifier", ".", "(", "type", ")", "{", "case", "*", "MethodMatch_ParameterMatchSpecifier_ExactMatch", ":", "// no validation rules for ExactMatch", "case", "*", "MethodMatch_ParameterMatchSpecifier_RangeMatch", ":", "{", "tmp", ":=", "m", ".", "GetRangeMatch", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "MethodMatch_ParameterMatchSpecifierValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on MethodMatch_ParameterMatchSpecifier with // the rules defined in the proto definition for this message. If any rules // are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "MethodMatch_ParameterMatchSpecifier", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/dubbo_proxy/v2alpha1/route.pb.validate.go#L504-L534
147,015
envoyproxy/go-control-plane
envoy/config/filter/network/dubbo_proxy/v2alpha1/dubbo_proxy.pb.validate.go
Validate
func (m *DubboProxy) Validate() error { if m == nil { return nil } if len(m.GetStatPrefix()) < 1 { return DubboProxyValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } if _, ok := ProtocolType_name[int32(m.GetProtocolType())]; !ok { return DubboProxyValidationError{ field: "ProtocolType", reason: "value must be one of the defined enum values", } } if _, ok := SerializationType_name[int32(m.GetSerializationType())]; !ok { return DubboProxyValidationError{ field: "SerializationType", reason: "value must be one of the defined enum values", } } for idx, item := range m.GetRouteConfig() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DubboProxyValidationError{ field: fmt.Sprintf("RouteConfig[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetDubboFilters() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DubboProxyValidationError{ field: fmt.Sprintf("DubboFilters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *DubboProxy) Validate() error { if m == nil { return nil } if len(m.GetStatPrefix()) < 1 { return DubboProxyValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } if _, ok := ProtocolType_name[int32(m.GetProtocolType())]; !ok { return DubboProxyValidationError{ field: "ProtocolType", reason: "value must be one of the defined enum values", } } if _, ok := SerializationType_name[int32(m.GetSerializationType())]; !ok { return DubboProxyValidationError{ field: "SerializationType", reason: "value must be one of the defined enum values", } } for idx, item := range m.GetRouteConfig() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DubboProxyValidationError{ field: fmt.Sprintf("RouteConfig[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetDubboFilters() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DubboProxyValidationError{ field: fmt.Sprintf("DubboFilters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "DubboProxy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetStatPrefix", "(", ")", ")", "<", "1", "{", "return", "DubboProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "ProtocolType_name", "[", "int32", "(", "m", ".", "GetProtocolType", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "DubboProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "SerializationType_name", "[", "int32", "(", "m", ".", "GetSerializationType", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "DubboProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRouteConfig", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "DubboProxyValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetDubboFilters", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "DubboProxyValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on DubboProxy with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "DubboProxy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/dubbo_proxy/v2alpha1/dubbo_proxy.pb.validate.go#L38-L105
147,016
envoyproxy/go-control-plane
envoy/config/filter/network/dubbo_proxy/v2alpha1/dubbo_proxy.pb.validate.go
Validate
func (m *DubboFilter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return DubboFilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DubboFilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *DubboFilter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return DubboFilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DubboFilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "DubboFilter", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "DubboFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "DubboFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on DubboFilter with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "DubboFilter", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/dubbo_proxy/v2alpha1/dubbo_proxy.pb.validate.go#L164-L192
147,017
envoyproxy/go-control-plane
envoy/config/common/tap/v2alpha/common.pb.validate.go
Validate
func (m *CommonExtensionConfig) Validate() error { if m == nil { return nil } switch m.ConfigType.(type) { case *CommonExtensionConfig_AdminConfig: { tmp := m.GetAdminConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonExtensionConfigValidationError{ field: "AdminConfig", reason: "embedded message failed validation", cause: err, } } } } case *CommonExtensionConfig_StaticConfig: { tmp := m.GetStaticConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonExtensionConfigValidationError{ field: "StaticConfig", reason: "embedded message failed validation", cause: err, } } } } default: return CommonExtensionConfigValidationError{ field: "ConfigType", reason: "value is required", } } return nil }
go
func (m *CommonExtensionConfig) Validate() error { if m == nil { return nil } switch m.ConfigType.(type) { case *CommonExtensionConfig_AdminConfig: { tmp := m.GetAdminConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonExtensionConfigValidationError{ field: "AdminConfig", reason: "embedded message failed validation", cause: err, } } } } case *CommonExtensionConfig_StaticConfig: { tmp := m.GetStaticConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CommonExtensionConfigValidationError{ field: "StaticConfig", reason: "embedded message failed validation", cause: err, } } } } default: return CommonExtensionConfigValidationError{ field: "ConfigType", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "CommonExtensionConfig", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "ConfigType", ".", "(", "type", ")", "{", "case", "*", "CommonExtensionConfig_AdminConfig", ":", "{", "tmp", ":=", "m", ".", "GetAdminConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CommonExtensionConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "CommonExtensionConfig_StaticConfig", ":", "{", "tmp", ":=", "m", ".", "GetStaticConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CommonExtensionConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "default", ":", "return", "CommonExtensionConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on CommonExtensionConfig with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "CommonExtensionConfig", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/common/tap/v2alpha/common.pb.validate.go#L39-L89
147,018
envoyproxy/go-control-plane
envoy/config/common/tap/v2alpha/common.pb.validate.go
Validate
func (m *AdminConfig) Validate() error { if m == nil { return nil } if len(m.GetConfigId()) < 1 { return AdminConfigValidationError{ field: "ConfigId", reason: "value length must be at least 1 bytes", } } return nil }
go
func (m *AdminConfig) Validate() error { if m == nil { return nil } if len(m.GetConfigId()) < 1 { return AdminConfigValidationError{ field: "ConfigId", reason: "value length must be at least 1 bytes", } } return nil }
[ "func", "(", "m", "*", "AdminConfig", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetConfigId", "(", ")", ")", "<", "1", "{", "return", "AdminConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on AdminConfig with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "AdminConfig", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/common/tap/v2alpha/common.pb.validate.go#L150-L163
147,019
envoyproxy/go-control-plane
envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.pb.validate.go
Validate
func (m *FilterConfig) Validate() error { if m == nil { return nil } if len(m.GetContentType()) < 1 { return FilterConfigValidationError{ field: "ContentType", reason: "value length must be at least 1 bytes", } } // no validation rules for WithholdGrpcFrames return nil }
go
func (m *FilterConfig) Validate() error { if m == nil { return nil } if len(m.GetContentType()) < 1 { return FilterConfigValidationError{ field: "ContentType", reason: "value length must be at least 1 bytes", } } // no validation rules for WithholdGrpcFrames return nil }
[ "func", "(", "m", "*", "FilterConfig", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetContentType", "(", ")", ")", "<", "1", "{", "return", "FilterConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for WithholdGrpcFrames", "return", "nil", "\n", "}" ]
// Validate checks the field values on FilterConfig with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FilterConfig", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/grpc_http1_reverse_bridge/v2alpha1/config.pb.validate.go#L39-L54
147,020
envoyproxy/go-control-plane
envoy/config/filter/network/thrift_proxy/v2alpha1/thrift_proxy.pb.validate.go
Validate
func (m *ThriftProxy) Validate() error { if m == nil { return nil } if _, ok := TransportType_name[int32(m.GetTransport())]; !ok { return ThriftProxyValidationError{ field: "Transport", reason: "value must be one of the defined enum values", } } if _, ok := ProtocolType_name[int32(m.GetProtocol())]; !ok { return ThriftProxyValidationError{ field: "Protocol", reason: "value must be one of the defined enum values", } } if len(m.GetStatPrefix()) < 1 { return ThriftProxyValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } { tmp := m.GetRouteConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftProxyValidationError{ field: "RouteConfig", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetThriftFilters() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftProxyValidationError{ field: fmt.Sprintf("ThriftFilters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *ThriftProxy) Validate() error { if m == nil { return nil } if _, ok := TransportType_name[int32(m.GetTransport())]; !ok { return ThriftProxyValidationError{ field: "Transport", reason: "value must be one of the defined enum values", } } if _, ok := ProtocolType_name[int32(m.GetProtocol())]; !ok { return ThriftProxyValidationError{ field: "Protocol", reason: "value must be one of the defined enum values", } } if len(m.GetStatPrefix()) < 1 { return ThriftProxyValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } { tmp := m.GetRouteConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftProxyValidationError{ field: "RouteConfig", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetThriftFilters() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftProxyValidationError{ field: fmt.Sprintf("ThriftFilters[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "ThriftProxy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "TransportType_name", "[", "int32", "(", "m", ".", "GetTransport", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "ThriftProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "ProtocolType_name", "[", "int32", "(", "m", ".", "GetProtocol", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "ThriftProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetStatPrefix", "(", ")", ")", "<", "1", "{", "return", "ThriftProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetRouteConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ThriftProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetThriftFilters", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ThriftProxyValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ThriftProxy with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ThriftProxy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/thrift_proxy/v2alpha1/thrift_proxy.pb.validate.go#L39-L101
147,021
envoyproxy/go-control-plane
envoy/config/filter/network/thrift_proxy/v2alpha1/thrift_proxy.pb.validate.go
Validate
func (m *ThriftFilter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return ThriftFilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *ThriftFilter_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftFilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *ThriftFilter_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftFilterValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *ThriftFilter) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return ThriftFilterValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *ThriftFilter_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftFilterValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *ThriftFilter_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ThriftFilterValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "ThriftFilter", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "ThriftFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "ConfigType", ".", "(", "type", ")", "{", "case", "*", "ThriftFilter_Config", ":", "{", "tmp", ":=", "m", ".", "GetConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ThriftFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "ThriftFilter_TypedConfig", ":", "{", "tmp", ":=", "m", ".", "GetTypedConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ThriftFilterValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ThriftFilter with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ThriftFilter", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/thrift_proxy/v2alpha1/thrift_proxy.pb.validate.go#L160-L211
147,022
envoyproxy/go-control-plane
envoy/config/filter/network/thrift_proxy/v2alpha1/thrift_proxy.pb.validate.go
Validate
func (m *ThriftProtocolOptions) Validate() error { if m == nil { return nil } if _, ok := TransportType_name[int32(m.GetTransport())]; !ok { return ThriftProtocolOptionsValidationError{ field: "Transport", reason: "value must be one of the defined enum values", } } if _, ok := ProtocolType_name[int32(m.GetProtocol())]; !ok { return ThriftProtocolOptionsValidationError{ field: "Protocol", reason: "value must be one of the defined enum values", } } return nil }
go
func (m *ThriftProtocolOptions) Validate() error { if m == nil { return nil } if _, ok := TransportType_name[int32(m.GetTransport())]; !ok { return ThriftProtocolOptionsValidationError{ field: "Transport", reason: "value must be one of the defined enum values", } } if _, ok := ProtocolType_name[int32(m.GetProtocol())]; !ok { return ThriftProtocolOptionsValidationError{ field: "Protocol", reason: "value must be one of the defined enum values", } } return nil }
[ "func", "(", "m", "*", "ThriftProtocolOptions", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "TransportType_name", "[", "int32", "(", "m", ".", "GetTransport", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "ThriftProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "ProtocolType_name", "[", "int32", "(", "m", ".", "GetProtocol", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "ThriftProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ThriftProtocolOptions with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ThriftProtocolOptions", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/thrift_proxy/v2alpha1/thrift_proxy.pb.validate.go#L270-L290
147,023
envoyproxy/go-control-plane
envoy/service/accesslog/v2/als.pb.validate.go
Validate
func (m *StreamAccessLogsMessage) Validate() error { if m == nil { return nil } { tmp := m.GetIdentifier() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessageValidationError{ field: "Identifier", reason: "embedded message failed validation", cause: err, } } } } switch m.LogEntries.(type) { case *StreamAccessLogsMessage_HttpLogs: { tmp := m.GetHttpLogs() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessageValidationError{ field: "HttpLogs", reason: "embedded message failed validation", cause: err, } } } } case *StreamAccessLogsMessage_TcpLogs: { tmp := m.GetTcpLogs() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessageValidationError{ field: "TcpLogs", reason: "embedded message failed validation", cause: err, } } } } default: return StreamAccessLogsMessageValidationError{ field: "LogEntries", reason: "value is required", } } return nil }
go
func (m *StreamAccessLogsMessage) Validate() error { if m == nil { return nil } { tmp := m.GetIdentifier() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessageValidationError{ field: "Identifier", reason: "embedded message failed validation", cause: err, } } } } switch m.LogEntries.(type) { case *StreamAccessLogsMessage_HttpLogs: { tmp := m.GetHttpLogs() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessageValidationError{ field: "HttpLogs", reason: "embedded message failed validation", cause: err, } } } } case *StreamAccessLogsMessage_TcpLogs: { tmp := m.GetTcpLogs() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessageValidationError{ field: "TcpLogs", reason: "embedded message failed validation", cause: err, } } } } default: return StreamAccessLogsMessageValidationError{ field: "LogEntries", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "StreamAccessLogsMessage", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetIdentifier", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "StreamAccessLogsMessageValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "switch", "m", ".", "LogEntries", ".", "(", "type", ")", "{", "case", "*", "StreamAccessLogsMessage_HttpLogs", ":", "{", "tmp", ":=", "m", ".", "GetHttpLogs", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "StreamAccessLogsMessageValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "StreamAccessLogsMessage_TcpLogs", ":", "{", "tmp", ":=", "m", ".", "GetTcpLogs", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "StreamAccessLogsMessageValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "default", ":", "return", "StreamAccessLogsMessageValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on StreamAccessLogsMessage with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "StreamAccessLogsMessage", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/service/accesslog/v2/als.pb.validate.go#L106-L171
147,024
envoyproxy/go-control-plane
envoy/service/accesslog/v2/als.pb.validate.go
Validate
func (m *StreamAccessLogsMessage_Identifier) Validate() error { if m == nil { return nil } if m.GetNode() == nil { return StreamAccessLogsMessage_IdentifierValidationError{ field: "Node", reason: "value is required", } } { tmp := m.GetNode() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessage_IdentifierValidationError{ field: "Node", reason: "embedded message failed validation", cause: err, } } } } if len(m.GetLogName()) < 1 { return StreamAccessLogsMessage_IdentifierValidationError{ field: "LogName", reason: "value length must be at least 1 bytes", } } return nil }
go
func (m *StreamAccessLogsMessage_Identifier) Validate() error { if m == nil { return nil } if m.GetNode() == nil { return StreamAccessLogsMessage_IdentifierValidationError{ field: "Node", reason: "value is required", } } { tmp := m.GetNode() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessage_IdentifierValidationError{ field: "Node", reason: "embedded message failed validation", cause: err, } } } } if len(m.GetLogName()) < 1 { return StreamAccessLogsMessage_IdentifierValidationError{ field: "LogName", reason: "value length must be at least 1 bytes", } } return nil }
[ "func", "(", "m", "*", "StreamAccessLogsMessage_Identifier", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetNode", "(", ")", "==", "nil", "{", "return", "StreamAccessLogsMessage_IdentifierValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetNode", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "StreamAccessLogsMessage_IdentifierValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetLogName", "(", ")", ")", "<", "1", "{", "return", "StreamAccessLogsMessage_IdentifierValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on StreamAccessLogsMessage_Identifier with // the rules defined in the proto definition for this message. If any rules // are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "StreamAccessLogsMessage_Identifier", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/service/accesslog/v2/als.pb.validate.go#L232-L267
147,025
envoyproxy/go-control-plane
envoy/service/accesslog/v2/als.pb.validate.go
Validate
func (m *StreamAccessLogsMessage_TCPAccessLogEntries) Validate() error { if m == nil { return nil } if len(m.GetLogEntry()) < 1 { return StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{ field: "LogEntry", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetLogEntry() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{ field: fmt.Sprintf("LogEntry[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *StreamAccessLogsMessage_TCPAccessLogEntries) Validate() error { if m == nil { return nil } if len(m.GetLogEntry()) < 1 { return StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{ field: "LogEntry", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetLogEntry() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return StreamAccessLogsMessage_TCPAccessLogEntriesValidationError{ field: fmt.Sprintf("LogEntry[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "StreamAccessLogsMessage_TCPAccessLogEntries", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetLogEntry", "(", ")", ")", "<", "1", "{", "return", "StreamAccessLogsMessage_TCPAccessLogEntriesValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetLogEntry", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "StreamAccessLogsMessage_TCPAccessLogEntriesValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on // StreamAccessLogsMessage_TCPAccessLogEntries with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "StreamAccessLogsMessage_TCPAccessLogEntries", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/service/accesslog/v2/als.pb.validate.go#L425-L458
147,026
envoyproxy/go-control-plane
envoy/config/filter/http/buffer/v2/buffer.pb.validate.go
Validate
func (m *Buffer) Validate() error { if m == nil { return nil } if wrapper := m.GetMaxRequestBytes(); wrapper != nil { if wrapper.GetValue() <= 0 { return BufferValidationError{ field: "MaxRequestBytes", reason: "value must be greater than 0", } } } return nil }
go
func (m *Buffer) Validate() error { if m == nil { return nil } if wrapper := m.GetMaxRequestBytes(); wrapper != nil { if wrapper.GetValue() <= 0 { return BufferValidationError{ field: "MaxRequestBytes", reason: "value must be greater than 0", } } } return nil }
[ "func", "(", "m", "*", "Buffer", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetMaxRequestBytes", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "wrapper", ".", "GetValue", "(", ")", "<=", "0", "{", "return", "BufferValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Buffer with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Buffer", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/buffer/v2/buffer.pb.validate.go#L38-L55
147,027
envoyproxy/go-control-plane
envoy/config/filter/http/buffer/v2/buffer.pb.validate.go
Validate
func (m *BufferPerRoute) Validate() error { if m == nil { return nil } switch m.Override.(type) { case *BufferPerRoute_Disabled: if m.GetDisabled() != true { return BufferPerRouteValidationError{ field: "Disabled", reason: "value must equal true", } } case *BufferPerRoute_Buffer: if m.GetBuffer() == nil { return BufferPerRouteValidationError{ field: "Buffer", reason: "value is required", } } { tmp := m.GetBuffer() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return BufferPerRouteValidationError{ field: "Buffer", reason: "embedded message failed validation", cause: err, } } } } default: return BufferPerRouteValidationError{ field: "Override", reason: "value is required", } } return nil }
go
func (m *BufferPerRoute) Validate() error { if m == nil { return nil } switch m.Override.(type) { case *BufferPerRoute_Disabled: if m.GetDisabled() != true { return BufferPerRouteValidationError{ field: "Disabled", reason: "value must equal true", } } case *BufferPerRoute_Buffer: if m.GetBuffer() == nil { return BufferPerRouteValidationError{ field: "Buffer", reason: "value is required", } } { tmp := m.GetBuffer() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return BufferPerRouteValidationError{ field: "Buffer", reason: "embedded message failed validation", cause: err, } } } } default: return BufferPerRouteValidationError{ field: "Override", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "BufferPerRoute", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "Override", ".", "(", "type", ")", "{", "case", "*", "BufferPerRoute_Disabled", ":", "if", "m", ".", "GetDisabled", "(", ")", "!=", "true", "{", "return", "BufferPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "case", "*", "BufferPerRoute_Buffer", ":", "if", "m", ".", "GetBuffer", "(", ")", "==", "nil", "{", "return", "BufferPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetBuffer", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "BufferPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "default", ":", "return", "BufferPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on BufferPerRoute with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "BufferPerRoute", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/buffer/v2/buffer.pb.validate.go#L114-L163
147,028
envoyproxy/go-control-plane
envoy/config/accesslog/v2/file.pb.validate.go
Validate
func (m *FileAccessLog) Validate() error { if m == nil { return nil } if len(m.GetPath()) < 1 { return FileAccessLogValidationError{ field: "Path", reason: "value length must be at least 1 bytes", } } switch m.AccessLogFormat.(type) { case *FileAccessLog_Format: // no validation rules for Format case *FileAccessLog_JsonFormat: { tmp := m.GetJsonFormat() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FileAccessLogValidationError{ field: "JsonFormat", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *FileAccessLog) Validate() error { if m == nil { return nil } if len(m.GetPath()) < 1 { return FileAccessLogValidationError{ field: "Path", reason: "value length must be at least 1 bytes", } } switch m.AccessLogFormat.(type) { case *FileAccessLog_Format: // no validation rules for Format case *FileAccessLog_JsonFormat: { tmp := m.GetJsonFormat() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FileAccessLogValidationError{ field: "JsonFormat", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "FileAccessLog", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetPath", "(", ")", ")", "<", "1", "{", "return", "FileAccessLogValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "AccessLogFormat", ".", "(", "type", ")", "{", "case", "*", "FileAccessLog_Format", ":", "// no validation rules for Format", "case", "*", "FileAccessLog_JsonFormat", ":", "{", "tmp", ":=", "m", ".", "GetJsonFormat", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FileAccessLogValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on FileAccessLog with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FileAccessLog", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/accesslog/v2/file.pb.validate.go#L39-L76
147,029
envoyproxy/go-control-plane
envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go
Validate
func (m *BufferSettings) Validate() error { if m == nil { return nil } if m.GetMaxRequestBytes() <= 0 { return BufferSettingsValidationError{ field: "MaxRequestBytes", reason: "value must be greater than 0", } } // no validation rules for AllowPartialMessage return nil }
go
func (m *BufferSettings) Validate() error { if m == nil { return nil } if m.GetMaxRequestBytes() <= 0 { return BufferSettingsValidationError{ field: "MaxRequestBytes", reason: "value must be greater than 0", } } // no validation rules for AllowPartialMessage return nil }
[ "func", "(", "m", "*", "BufferSettings", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetMaxRequestBytes", "(", ")", "<=", "0", "{", "return", "BufferSettingsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for AllowPartialMessage", "return", "nil", "\n", "}" ]
// Validate checks the field values on BufferSettings with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "BufferSettings", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go#L162-L177
147,030
envoyproxy/go-control-plane
envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go
Validate
func (m *HttpService) Validate() error { if m == nil { return nil } { tmp := m.GetServerUri() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpServiceValidationError{ field: "ServerUri", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for PathPrefix { tmp := m.GetAuthorizationRequest() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpServiceValidationError{ field: "AuthorizationRequest", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAuthorizationResponse() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpServiceValidationError{ field: "AuthorizationResponse", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *HttpService) Validate() error { if m == nil { return nil } { tmp := m.GetServerUri() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpServiceValidationError{ field: "ServerUri", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for PathPrefix { tmp := m.GetAuthorizationRequest() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpServiceValidationError{ field: "AuthorizationRequest", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAuthorizationResponse() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpServiceValidationError{ field: "AuthorizationResponse", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "HttpService", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetServerUri", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpServiceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for PathPrefix", "{", "tmp", ":=", "m", ".", "GetAuthorizationRequest", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpServiceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAuthorizationResponse", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpServiceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HttpService with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HttpService", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go#L236-L289
147,031
envoyproxy/go-control-plane
envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go
Validate
func (m *AuthorizationRequest) Validate() error { if m == nil { return nil } { tmp := m.GetAllowedHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationRequestValidationError{ field: "AllowedHeaders", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetHeadersToAdd() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationRequestValidationError{ field: fmt.Sprintf("HeadersToAdd[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *AuthorizationRequest) Validate() error { if m == nil { return nil } { tmp := m.GetAllowedHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationRequestValidationError{ field: "AllowedHeaders", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetHeadersToAdd() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationRequestValidationError{ field: fmt.Sprintf("HeadersToAdd[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "AuthorizationRequest", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAllowedHeaders", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "AuthorizationRequestValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetHeadersToAdd", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "AuthorizationRequestValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on AuthorizationRequest with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "AuthorizationRequest", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go#L348-L389
147,032
envoyproxy/go-control-plane
envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go
Validate
func (m *AuthorizationResponse) Validate() error { if m == nil { return nil } { tmp := m.GetAllowedUpstreamHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationResponseValidationError{ field: "AllowedUpstreamHeaders", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAllowedClientHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationResponseValidationError{ field: "AllowedClientHeaders", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *AuthorizationResponse) Validate() error { if m == nil { return nil } { tmp := m.GetAllowedUpstreamHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationResponseValidationError{ field: "AllowedUpstreamHeaders", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAllowedClientHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return AuthorizationResponseValidationError{ field: "AllowedClientHeaders", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "AuthorizationResponse", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAllowedUpstreamHeaders", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "AuthorizationResponseValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAllowedClientHeaders", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "AuthorizationResponseValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on AuthorizationResponse with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "AuthorizationResponse", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go#L450-L486
147,033
envoyproxy/go-control-plane
envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go
Validate
func (m *ExtAuthzPerRoute) Validate() error { if m == nil { return nil } switch m.Override.(type) { case *ExtAuthzPerRoute_Disabled: if m.GetDisabled() != true { return ExtAuthzPerRouteValidationError{ field: "Disabled", reason: "value must equal true", } } case *ExtAuthzPerRoute_CheckSettings: if m.GetCheckSettings() == nil { return ExtAuthzPerRouteValidationError{ field: "CheckSettings", reason: "value is required", } } { tmp := m.GetCheckSettings() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ExtAuthzPerRouteValidationError{ field: "CheckSettings", reason: "embedded message failed validation", cause: err, } } } } default: return ExtAuthzPerRouteValidationError{ field: "Override", reason: "value is required", } } return nil }
go
func (m *ExtAuthzPerRoute) Validate() error { if m == nil { return nil } switch m.Override.(type) { case *ExtAuthzPerRoute_Disabled: if m.GetDisabled() != true { return ExtAuthzPerRouteValidationError{ field: "Disabled", reason: "value must equal true", } } case *ExtAuthzPerRoute_CheckSettings: if m.GetCheckSettings() == nil { return ExtAuthzPerRouteValidationError{ field: "CheckSettings", reason: "value is required", } } { tmp := m.GetCheckSettings() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ExtAuthzPerRouteValidationError{ field: "CheckSettings", reason: "embedded message failed validation", cause: err, } } } } default: return ExtAuthzPerRouteValidationError{ field: "Override", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "ExtAuthzPerRoute", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "Override", ".", "(", "type", ")", "{", "case", "*", "ExtAuthzPerRoute_Disabled", ":", "if", "m", ".", "GetDisabled", "(", ")", "!=", "true", "{", "return", "ExtAuthzPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "case", "*", "ExtAuthzPerRoute_CheckSettings", ":", "if", "m", ".", "GetCheckSettings", "(", ")", "==", "nil", "{", "return", "ExtAuthzPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetCheckSettings", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ExtAuthzPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "default", ":", "return", "ExtAuthzPerRouteValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ExtAuthzPerRoute with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ExtAuthzPerRoute", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/ext_authz/v2/ext_authz.pb.validate.go#L547-L596
147,034
envoyproxy/go-control-plane
pkg/cache/status.go
newStatusInfo
func newStatusInfo(node *core.Node) *statusInfo { out := statusInfo{ node: node, watches: make(map[int64]ResponseWatch), } return &out }
go
func newStatusInfo(node *core.Node) *statusInfo { out := statusInfo{ node: node, watches: make(map[int64]ResponseWatch), } return &out }
[ "func", "newStatusInfo", "(", "node", "*", "core", ".", "Node", ")", "*", "statusInfo", "{", "out", ":=", "statusInfo", "{", "node", ":", "node", ",", "watches", ":", "make", "(", "map", "[", "int64", "]", "ResponseWatch", ")", ",", "}", "\n", "return", "&", "out", "\n", "}" ]
// newStatusInfo initializes a status info data structure.
[ "newStatusInfo", "initializes", "a", "status", "info", "data", "structure", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/pkg/cache/status.go#L68-L74
147,035
envoyproxy/go-control-plane
envoy/api/v2/cluster/circuit_breaker.pb.validate.go
Validate
func (m *CircuitBreakers) Validate() error { if m == nil { return nil } for idx, item := range m.GetThresholds() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakersValidationError{ field: fmt.Sprintf("Thresholds[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *CircuitBreakers) Validate() error { if m == nil { return nil } for idx, item := range m.GetThresholds() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakersValidationError{ field: fmt.Sprintf("Thresholds[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "CircuitBreakers", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetThresholds", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CircuitBreakersValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on CircuitBreakers with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "CircuitBreakers", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/cluster/circuit_breaker.pb.validate.go#L43-L69
147,036
envoyproxy/go-control-plane
envoy/api/v2/cluster/circuit_breaker.pb.validate.go
Validate
func (m *CircuitBreakers_Thresholds) Validate() error { if m == nil { return nil } // no validation rules for Priority { tmp := m.GetMaxConnections() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxConnections", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMaxPendingRequests() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxPendingRequests", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMaxRequests() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxRequests", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMaxRetries() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxRetries", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TrackRemaining { tmp := m.GetMaxConnectionPools() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxConnectionPools", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *CircuitBreakers_Thresholds) Validate() error { if m == nil { return nil } // no validation rules for Priority { tmp := m.GetMaxConnections() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxConnections", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMaxPendingRequests() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxPendingRequests", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMaxRequests() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxRequests", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMaxRetries() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxRetries", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TrackRemaining { tmp := m.GetMaxConnectionPools() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CircuitBreakers_ThresholdsValidationError{ field: "MaxConnectionPools", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "CircuitBreakers_Thresholds", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Priority", "{", "tmp", ":=", "m", ".", "GetMaxConnections", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CircuitBreakers_ThresholdsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMaxPendingRequests", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CircuitBreakers_ThresholdsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMaxRequests", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CircuitBreakers_ThresholdsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMaxRetries", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CircuitBreakers_ThresholdsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for TrackRemaining", "{", "tmp", ":=", "m", ".", "GetMaxConnectionPools", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CircuitBreakers_ThresholdsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on CircuitBreakers_Thresholds with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "CircuitBreakers_Thresholds", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/cluster/circuit_breaker.pb.validate.go#L128-L213
147,037
envoyproxy/go-control-plane
envoy/data/tap/v2alpha/http.pb.validate.go
Validate
func (m *HttpBufferedTrace) Validate() error { if m == nil { return nil } { tmp := m.GetRequest() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTraceValidationError{ field: "Request", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetResponse() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTraceValidationError{ field: "Response", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *HttpBufferedTrace) Validate() error { if m == nil { return nil } { tmp := m.GetRequest() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTraceValidationError{ field: "Request", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetResponse() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTraceValidationError{ field: "Response", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "HttpBufferedTrace", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetRequest", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpBufferedTraceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetResponse", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpBufferedTraceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HttpBufferedTrace with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HttpBufferedTrace", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/data/tap/v2alpha/http.pb.validate.go#L39-L75
147,038
envoyproxy/go-control-plane
envoy/data/tap/v2alpha/http.pb.validate.go
Validate
func (m *HttpStreamedTraceSegment) Validate() error { if m == nil { return nil } // no validation rules for TraceId switch m.MessagePiece.(type) { case *HttpStreamedTraceSegment_RequestHeaders: { tmp := m.GetRequestHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "RequestHeaders", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_RequestBodyChunk: { tmp := m.GetRequestBodyChunk() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "RequestBodyChunk", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_RequestTrailers: { tmp := m.GetRequestTrailers() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "RequestTrailers", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_ResponseHeaders: { tmp := m.GetResponseHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "ResponseHeaders", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_ResponseBodyChunk: { tmp := m.GetResponseBodyChunk() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "ResponseBodyChunk", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_ResponseTrailers: { tmp := m.GetResponseTrailers() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "ResponseTrailers", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *HttpStreamedTraceSegment) Validate() error { if m == nil { return nil } // no validation rules for TraceId switch m.MessagePiece.(type) { case *HttpStreamedTraceSegment_RequestHeaders: { tmp := m.GetRequestHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "RequestHeaders", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_RequestBodyChunk: { tmp := m.GetRequestBodyChunk() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "RequestBodyChunk", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_RequestTrailers: { tmp := m.GetRequestTrailers() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "RequestTrailers", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_ResponseHeaders: { tmp := m.GetResponseHeaders() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "ResponseHeaders", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_ResponseBodyChunk: { tmp := m.GetResponseBodyChunk() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "ResponseBodyChunk", reason: "embedded message failed validation", cause: err, } } } } case *HttpStreamedTraceSegment_ResponseTrailers: { tmp := m.GetResponseTrailers() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpStreamedTraceSegmentValidationError{ field: "ResponseTrailers", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "HttpStreamedTraceSegment", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for TraceId", "switch", "m", ".", "MessagePiece", ".", "(", "type", ")", "{", "case", "*", "HttpStreamedTraceSegment_RequestHeaders", ":", "{", "tmp", ":=", "m", ".", "GetRequestHeaders", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpStreamedTraceSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "HttpStreamedTraceSegment_RequestBodyChunk", ":", "{", "tmp", ":=", "m", ".", "GetRequestBodyChunk", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpStreamedTraceSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "HttpStreamedTraceSegment_RequestTrailers", ":", "{", "tmp", ":=", "m", ".", "GetRequestTrailers", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpStreamedTraceSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "HttpStreamedTraceSegment_ResponseHeaders", ":", "{", "tmp", ":=", "m", ".", "GetResponseHeaders", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpStreamedTraceSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "HttpStreamedTraceSegment_ResponseBodyChunk", ":", "{", "tmp", ":=", "m", ".", "GetResponseBodyChunk", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpStreamedTraceSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "HttpStreamedTraceSegment_ResponseTrailers", ":", "{", "tmp", ":=", "m", ".", "GetResponseTrailers", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpStreamedTraceSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HttpStreamedTraceSegment with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HttpStreamedTraceSegment", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/data/tap/v2alpha/http.pb.validate.go#L136-L250
147,039
envoyproxy/go-control-plane
envoy/data/tap/v2alpha/http.pb.validate.go
Validate
func (m *HttpBufferedTrace_Message) Validate() error { if m == nil { return nil } for idx, item := range m.GetHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTrace_MessageValidationError{ field: fmt.Sprintf("Headers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetBody() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTrace_MessageValidationError{ field: "Body", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetTrailers() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTrace_MessageValidationError{ field: fmt.Sprintf("Trailers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *HttpBufferedTrace_Message) Validate() error { if m == nil { return nil } for idx, item := range m.GetHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTrace_MessageValidationError{ field: fmt.Sprintf("Headers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetBody() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTrace_MessageValidationError{ field: "Body", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetTrailers() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpBufferedTrace_MessageValidationError{ field: fmt.Sprintf("Trailers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "HttpBufferedTrace_Message", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetHeaders", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpBufferedTrace_MessageValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetBody", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpBufferedTrace_MessageValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetTrailers", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpBufferedTrace_MessageValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HttpBufferedTrace_Message with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HttpBufferedTrace_Message", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/data/tap/v2alpha/http.pb.validate.go#L311-L372
147,040
envoyproxy/go-control-plane
envoy/config/transport_socket/alts/v2alpha/alts.pb.validate.go
Validate
func (m *Alts) Validate() error { if m == nil { return nil } if len(m.GetHandshakerService()) < 1 { return AltsValidationError{ field: "HandshakerService", reason: "value length must be at least 1 bytes", } } return nil }
go
func (m *Alts) Validate() error { if m == nil { return nil } if len(m.GetHandshakerService()) < 1 { return AltsValidationError{ field: "HandshakerService", reason: "value length must be at least 1 bytes", } } return nil }
[ "func", "(", "m", "*", "Alts", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetHandshakerService", "(", ")", ")", "<", "1", "{", "return", "AltsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Alts with the rules defined in the proto // definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Alts", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/transport_socket/alts/v2alpha/alts.pb.validate.go#L38-L51
147,041
envoyproxy/go-control-plane
envoy/api/v2/core/health_check.pb.validate.go
Validate
func (m *HealthCheck_Payload) Validate() error { if m == nil { return nil } switch m.Payload.(type) { case *HealthCheck_Payload_Text: if len(m.GetText()) < 1 { return HealthCheck_PayloadValidationError{ field: "Text", reason: "value length must be at least 1 bytes", } } case *HealthCheck_Payload_Binary: // no validation rules for Binary default: return HealthCheck_PayloadValidationError{ field: "Payload", reason: "value is required", } } return nil }
go
func (m *HealthCheck_Payload) Validate() error { if m == nil { return nil } switch m.Payload.(type) { case *HealthCheck_Payload_Text: if len(m.GetText()) < 1 { return HealthCheck_PayloadValidationError{ field: "Text", reason: "value length must be at least 1 bytes", } } case *HealthCheck_Payload_Binary: // no validation rules for Binary default: return HealthCheck_PayloadValidationError{ field: "Payload", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "HealthCheck_Payload", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "Payload", ".", "(", "type", ")", "{", "case", "*", "HealthCheck_Payload_Text", ":", "if", "len", "(", "m", ".", "GetText", "(", ")", ")", "<", "1", "{", "return", "HealthCheck_PayloadValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "case", "*", "HealthCheck_Payload_Binary", ":", "// no validation rules for Binary", "default", ":", "return", "HealthCheck_PayloadValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HealthCheck_Payload with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HealthCheck_Payload", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/health_check.pb.validate.go#L389-L417
147,042
envoyproxy/go-control-plane
envoy/api/v2/core/health_check.pb.validate.go
Validate
func (m *HealthCheck_HttpHealthCheck) Validate() error { if m == nil { return nil } // no validation rules for Host if len(m.GetPath()) < 1 { return HealthCheck_HttpHealthCheckValidationError{ field: "Path", reason: "value length must be at least 1 bytes", } } { tmp := m.GetSend() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: "Send", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetReceive() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: "Receive", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for ServiceName if len(m.GetRequestHeadersToAdd()) > 1000 { return HealthCheck_HttpHealthCheckValidationError{ field: "RequestHeadersToAdd", reason: "value must contain no more than 1000 item(s)", } } for idx, item := range m.GetRequestHeadersToAdd() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for UseHttp2 for idx, item := range m.GetExpectedStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: fmt.Sprintf("ExpectedStatuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *HealthCheck_HttpHealthCheck) Validate() error { if m == nil { return nil } // no validation rules for Host if len(m.GetPath()) < 1 { return HealthCheck_HttpHealthCheckValidationError{ field: "Path", reason: "value length must be at least 1 bytes", } } { tmp := m.GetSend() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: "Send", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetReceive() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: "Receive", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for ServiceName if len(m.GetRequestHeadersToAdd()) > 1000 { return HealthCheck_HttpHealthCheckValidationError{ field: "RequestHeadersToAdd", reason: "value must contain no more than 1000 item(s)", } } for idx, item := range m.GetRequestHeadersToAdd() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: fmt.Sprintf("RequestHeadersToAdd[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for UseHttp2 for idx, item := range m.GetExpectedStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_HttpHealthCheckValidationError{ field: fmt.Sprintf("ExpectedStatuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "HealthCheck_HttpHealthCheck", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Host", "if", "len", "(", "m", ".", "GetPath", "(", ")", ")", "<", "1", "{", "return", "HealthCheck_HttpHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetSend", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_HttpHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetReceive", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_HttpHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for ServiceName", "if", "len", "(", "m", ".", "GetRequestHeadersToAdd", "(", ")", ")", ">", "1000", "{", "return", "HealthCheck_HttpHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRequestHeadersToAdd", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_HttpHealthCheckValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for UseHttp2", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetExpectedStatuses", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_HttpHealthCheckValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HealthCheck_HttpHealthCheck with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HealthCheck_HttpHealthCheck", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/health_check.pb.validate.go#L478-L574
147,043
envoyproxy/go-control-plane
envoy/api/v2/core/health_check.pb.validate.go
Validate
func (m *HealthCheck_TcpHealthCheck) Validate() error { if m == nil { return nil } { tmp := m.GetSend() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_TcpHealthCheckValidationError{ field: "Send", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetReceive() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_TcpHealthCheckValidationError{ field: fmt.Sprintf("Receive[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *HealthCheck_TcpHealthCheck) Validate() error { if m == nil { return nil } { tmp := m.GetSend() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_TcpHealthCheckValidationError{ field: "Send", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetReceive() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_TcpHealthCheckValidationError{ field: fmt.Sprintf("Receive[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "HealthCheck_TcpHealthCheck", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetSend", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_TcpHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetReceive", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_TcpHealthCheckValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HealthCheck_TcpHealthCheck with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HealthCheck_TcpHealthCheck", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/health_check.pb.validate.go#L636-L677
147,044
envoyproxy/go-control-plane
envoy/api/v2/core/health_check.pb.validate.go
Validate
func (m *HealthCheck_CustomHealthCheck) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return HealthCheck_CustomHealthCheckValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *HealthCheck_CustomHealthCheck_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_CustomHealthCheckValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *HealthCheck_CustomHealthCheck_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_CustomHealthCheckValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *HealthCheck_CustomHealthCheck) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return HealthCheck_CustomHealthCheckValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *HealthCheck_CustomHealthCheck_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_CustomHealthCheckValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *HealthCheck_CustomHealthCheck_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HealthCheck_CustomHealthCheckValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "HealthCheck_CustomHealthCheck", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "HealthCheck_CustomHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "ConfigType", ".", "(", "type", ")", "{", "case", "*", "HealthCheck_CustomHealthCheck_Config", ":", "{", "tmp", ":=", "m", ".", "GetConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_CustomHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "HealthCheck_CustomHealthCheck_TypedConfig", ":", "{", "tmp", ":=", "m", ".", "GetTypedConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HealthCheck_CustomHealthCheckValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HealthCheck_CustomHealthCheck with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HealthCheck_CustomHealthCheck", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/health_check.pb.validate.go#L880-L931
147,045
envoyproxy/go-control-plane
envoy/api/v2/endpoint/load_report.pb.validate.go
Validate
func (m *UpstreamLocalityStats) Validate() error { if m == nil { return nil } { tmp := m.GetLocality() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamLocalityStatsValidationError{ field: "Locality", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TotalSuccessfulRequests // no validation rules for TotalRequestsInProgress // no validation rules for TotalErrorRequests for idx, item := range m.GetLoadMetricStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamLocalityStatsValidationError{ field: fmt.Sprintf("LoadMetricStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetUpstreamEndpointStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamLocalityStatsValidationError{ field: fmt.Sprintf("UpstreamEndpointStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for Priority return nil }
go
func (m *UpstreamLocalityStats) Validate() error { if m == nil { return nil } { tmp := m.GetLocality() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamLocalityStatsValidationError{ field: "Locality", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TotalSuccessfulRequests // no validation rules for TotalRequestsInProgress // no validation rules for TotalErrorRequests for idx, item := range m.GetLoadMetricStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamLocalityStatsValidationError{ field: fmt.Sprintf("LoadMetricStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetUpstreamEndpointStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamLocalityStatsValidationError{ field: fmt.Sprintf("UpstreamEndpointStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for Priority return nil }
[ "func", "(", "m", "*", "UpstreamLocalityStats", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetLocality", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "UpstreamLocalityStatsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for TotalSuccessfulRequests", "// no validation rules for TotalRequestsInProgress", "// no validation rules for TotalErrorRequests", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetLoadMetricStats", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "UpstreamLocalityStatsValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetUpstreamEndpointStats", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "UpstreamLocalityStatsValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for Priority", "return", "nil", "\n", "}" ]
// Validate checks the field values on UpstreamLocalityStats with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "UpstreamLocalityStats", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/load_report.pb.validate.go#L39-L108
147,046
envoyproxy/go-control-plane
envoy/api/v2/endpoint/load_report.pb.validate.go
Validate
func (m *UpstreamEndpointStats) Validate() error { if m == nil { return nil } { tmp := m.GetAddress() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamEndpointStatsValidationError{ field: "Address", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamEndpointStatsValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TotalSuccessfulRequests // no validation rules for TotalRequestsInProgress // no validation rules for TotalErrorRequests for idx, item := range m.GetLoadMetricStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamEndpointStatsValidationError{ field: fmt.Sprintf("LoadMetricStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *UpstreamEndpointStats) Validate() error { if m == nil { return nil } { tmp := m.GetAddress() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamEndpointStatsValidationError{ field: "Address", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamEndpointStatsValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TotalSuccessfulRequests // no validation rules for TotalRequestsInProgress // no validation rules for TotalErrorRequests for idx, item := range m.GetLoadMetricStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return UpstreamEndpointStatsValidationError{ field: fmt.Sprintf("LoadMetricStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "UpstreamEndpointStats", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAddress", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "UpstreamEndpointStatsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMetadata", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "UpstreamEndpointStatsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for TotalSuccessfulRequests", "// no validation rules for TotalRequestsInProgress", "// no validation rules for TotalErrorRequests", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetLoadMetricStats", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "UpstreamEndpointStatsValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on UpstreamEndpointStats with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "UpstreamEndpointStats", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/load_report.pb.validate.go#L169-L231
147,047
envoyproxy/go-control-plane
envoy/api/v2/endpoint/load_report.pb.validate.go
Validate
func (m *ClusterStats) Validate() error { if m == nil { return nil } if len(m.GetClusterName()) < 1 { return ClusterStatsValidationError{ field: "ClusterName", reason: "value length must be at least 1 bytes", } } // no validation rules for ClusterServiceName if len(m.GetUpstreamLocalityStats()) < 1 { return ClusterStatsValidationError{ field: "UpstreamLocalityStats", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetUpstreamLocalityStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatsValidationError{ field: fmt.Sprintf("UpstreamLocalityStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for TotalDroppedRequests for idx, item := range m.GetDroppedRequests() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatsValidationError{ field: fmt.Sprintf("DroppedRequests[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetLoadReportInterval() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatsValidationError{ field: "LoadReportInterval", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *ClusterStats) Validate() error { if m == nil { return nil } if len(m.GetClusterName()) < 1 { return ClusterStatsValidationError{ field: "ClusterName", reason: "value length must be at least 1 bytes", } } // no validation rules for ClusterServiceName if len(m.GetUpstreamLocalityStats()) < 1 { return ClusterStatsValidationError{ field: "UpstreamLocalityStats", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetUpstreamLocalityStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatsValidationError{ field: fmt.Sprintf("UpstreamLocalityStats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for TotalDroppedRequests for idx, item := range m.GetDroppedRequests() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatsValidationError{ field: fmt.Sprintf("DroppedRequests[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetLoadReportInterval() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatsValidationError{ field: "LoadReportInterval", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "ClusterStats", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetClusterName", "(", ")", ")", "<", "1", "{", "return", "ClusterStatsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for ClusterServiceName", "if", "len", "(", "m", ".", "GetUpstreamLocalityStats", "(", ")", ")", "<", "1", "{", "return", "ClusterStatsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetUpstreamLocalityStats", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClusterStatsValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for TotalDroppedRequests", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetDroppedRequests", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClusterStatsValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetLoadReportInterval", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClusterStatsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ClusterStats with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ClusterStats", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/load_report.pb.validate.go#L365-L444
147,048
envoyproxy/go-control-plane
envoy/api/v2/endpoint/load_report.pb.validate.go
Validate
func (m *ClusterStats_DroppedRequests) Validate() error { if m == nil { return nil } if len(m.GetCategory()) < 1 { return ClusterStats_DroppedRequestsValidationError{ field: "Category", reason: "value length must be at least 1 bytes", } } // no validation rules for DroppedCount return nil }
go
func (m *ClusterStats_DroppedRequests) Validate() error { if m == nil { return nil } if len(m.GetCategory()) < 1 { return ClusterStats_DroppedRequestsValidationError{ field: "Category", reason: "value length must be at least 1 bytes", } } // no validation rules for DroppedCount return nil }
[ "func", "(", "m", "*", "ClusterStats_DroppedRequests", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetCategory", "(", ")", ")", "<", "1", "{", "return", "ClusterStats_DroppedRequestsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for DroppedCount", "return", "nil", "\n", "}" ]
// Validate checks the field values on ClusterStats_DroppedRequests with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ClusterStats_DroppedRequests", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/load_report.pb.validate.go#L503-L518
147,049
envoyproxy/go-control-plane
envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.pb.validate.go
Validate
func (m *Config) Validate() error { if m == nil { return nil } for idx, item := range m.GetRequestRules() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ConfigValidationError{ field: fmt.Sprintf("RequestRules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetResponseRules() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ConfigValidationError{ field: fmt.Sprintf("ResponseRules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *Config) Validate() error { if m == nil { return nil } for idx, item := range m.GetRequestRules() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ConfigValidationError{ field: fmt.Sprintf("RequestRules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetResponseRules() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ConfigValidationError{ field: fmt.Sprintf("ResponseRules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "Config", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRequestRules", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ConfigValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetResponseRules", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ConfigValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Config with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Config", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.pb.validate.go#L38-L84
147,050
envoyproxy/go-control-plane
envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.pb.validate.go
Validate
func (m *Config_KeyValuePair) Validate() error { if m == nil { return nil } // no validation rules for MetadataNamespace if len(m.GetKey()) < 1 { return Config_KeyValuePairValidationError{ field: "Key", reason: "value length must be at least 1 bytes", } } // no validation rules for Value // no validation rules for Type return nil }
go
func (m *Config_KeyValuePair) Validate() error { if m == nil { return nil } // no validation rules for MetadataNamespace if len(m.GetKey()) < 1 { return Config_KeyValuePairValidationError{ field: "Key", reason: "value length must be at least 1 bytes", } } // no validation rules for Value // no validation rules for Type return nil }
[ "func", "(", "m", "*", "Config_KeyValuePair", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for MetadataNamespace", "if", "len", "(", "m", ".", "GetKey", "(", ")", ")", "<", "1", "{", "return", "Config_KeyValuePairValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for Value", "// no validation rules for Type", "return", "nil", "\n", "}" ]
// Validate checks the field values on Config_KeyValuePair with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Config_KeyValuePair", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.pb.validate.go#L143-L162
147,051
envoyproxy/go-control-plane
envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.pb.validate.go
Validate
func (m *Config_Rule) Validate() error { if m == nil { return nil } if len(m.GetHeader()) < 1 { return Config_RuleValidationError{ field: "Header", reason: "value length must be at least 1 bytes", } } { tmp := m.GetOnHeaderPresent() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Config_RuleValidationError{ field: "OnHeaderPresent", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetOnHeaderMissing() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Config_RuleValidationError{ field: "OnHeaderMissing", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for Remove return nil }
go
func (m *Config_Rule) Validate() error { if m == nil { return nil } if len(m.GetHeader()) < 1 { return Config_RuleValidationError{ field: "Header", reason: "value length must be at least 1 bytes", } } { tmp := m.GetOnHeaderPresent() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Config_RuleValidationError{ field: "OnHeaderPresent", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetOnHeaderMissing() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Config_RuleValidationError{ field: "OnHeaderMissing", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for Remove return nil }
[ "func", "(", "m", "*", "Config_Rule", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetHeader", "(", ")", ")", "<", "1", "{", "return", "Config_RuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetOnHeaderPresent", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "Config_RuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetOnHeaderMissing", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "Config_RuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for Remove", "return", "nil", "\n", "}" ]
// Validate checks the field values on Config_Rule with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Config_Rule", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/header_to_metadata/v2/header_to_metadata.pb.validate.go#L223-L268
147,052
envoyproxy/go-control-plane
pkg/util/struct.go
StructToMessage
func StructToMessage(pbst *types.Struct, out proto.Message) error { if pbst == nil { return errors.New("nil struct") } buf := &bytes.Buffer{} if err := (&jsonpb.Marshaler{OrigName: true}).Marshal(buf, pbst); err != nil { return err } return jsonpb.Unmarshal(buf, out) }
go
func StructToMessage(pbst *types.Struct, out proto.Message) error { if pbst == nil { return errors.New("nil struct") } buf := &bytes.Buffer{} if err := (&jsonpb.Marshaler{OrigName: true}).Marshal(buf, pbst); err != nil { return err } return jsonpb.Unmarshal(buf, out) }
[ "func", "StructToMessage", "(", "pbst", "*", "types", ".", "Struct", ",", "out", "proto", ".", "Message", ")", "error", "{", "if", "pbst", "==", "nil", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "buf", ":=", "&", "bytes", ".", "Buffer", "{", "}", "\n", "if", "err", ":=", "(", "&", "jsonpb", ".", "Marshaler", "{", "OrigName", ":", "true", "}", ")", ".", "Marshal", "(", "buf", ",", "pbst", ")", ";", "err", "!=", "nil", "{", "return", "err", "\n", "}", "\n\n", "return", "jsonpb", ".", "Unmarshal", "(", "buf", ",", "out", ")", "\n", "}" ]
// StructToMessage decodes a protobuf Message from a Struct.
[ "StructToMessage", "decodes", "a", "protobuf", "Message", "from", "a", "Struct", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/pkg/util/struct.go#L49-L60
147,053
envoyproxy/go-control-plane
envoy/api/v2/core/http_uri.pb.validate.go
Validate
func (m *HttpUri) Validate() error { if m == nil { return nil } if len(m.GetUri()) < 1 { return HttpUriValidationError{ field: "Uri", reason: "value length must be at least 1 bytes", } } if m.GetTimeout() == nil { return HttpUriValidationError{ field: "Timeout", reason: "value is required", } } switch m.HttpUpstreamType.(type) { case *HttpUri_Cluster: if len(m.GetCluster()) < 1 { return HttpUriValidationError{ field: "Cluster", reason: "value length must be at least 1 bytes", } } default: return HttpUriValidationError{ field: "HttpUpstreamType", reason: "value is required", } } return nil }
go
func (m *HttpUri) Validate() error { if m == nil { return nil } if len(m.GetUri()) < 1 { return HttpUriValidationError{ field: "Uri", reason: "value length must be at least 1 bytes", } } if m.GetTimeout() == nil { return HttpUriValidationError{ field: "Timeout", reason: "value is required", } } switch m.HttpUpstreamType.(type) { case *HttpUri_Cluster: if len(m.GetCluster()) < 1 { return HttpUriValidationError{ field: "Cluster", reason: "value length must be at least 1 bytes", } } default: return HttpUriValidationError{ field: "HttpUpstreamType", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "HttpUri", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetUri", "(", ")", ")", "<", "1", "{", "return", "HttpUriValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "m", ".", "GetTimeout", "(", ")", "==", "nil", "{", "return", "HttpUriValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "HttpUpstreamType", ".", "(", "type", ")", "{", "case", "*", "HttpUri_Cluster", ":", "if", "len", "(", "m", ".", "GetCluster", "(", ")", ")", "<", "1", "{", "return", "HttpUriValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "default", ":", "return", "HttpUriValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HttpUri with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HttpUri", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/http_uri.pb.validate.go#L38-L77
147,054
envoyproxy/go-control-plane
envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.pb.validate.go
Validate
func (m *ClientSSLAuth) Validate() error { if m == nil { return nil } if len(m.GetAuthApiCluster()) < 1 { return ClientSSLAuthValidationError{ field: "AuthApiCluster", reason: "value length must be at least 1 bytes", } } if len(m.GetStatPrefix()) < 1 { return ClientSSLAuthValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } { tmp := m.GetRefreshDelay() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClientSSLAuthValidationError{ field: "RefreshDelay", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetIpWhiteList() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClientSSLAuthValidationError{ field: fmt.Sprintf("IpWhiteList[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *ClientSSLAuth) Validate() error { if m == nil { return nil } if len(m.GetAuthApiCluster()) < 1 { return ClientSSLAuthValidationError{ field: "AuthApiCluster", reason: "value length must be at least 1 bytes", } } if len(m.GetStatPrefix()) < 1 { return ClientSSLAuthValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } { tmp := m.GetRefreshDelay() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClientSSLAuthValidationError{ field: "RefreshDelay", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetIpWhiteList() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClientSSLAuthValidationError{ field: fmt.Sprintf("IpWhiteList[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "ClientSSLAuth", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetAuthApiCluster", "(", ")", ")", "<", "1", "{", "return", "ClientSSLAuthValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetStatPrefix", "(", ")", ")", "<", "1", "{", "return", "ClientSSLAuthValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetRefreshDelay", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClientSSLAuthValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetIpWhiteList", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClientSSLAuthValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ClientSSLAuth with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ClientSSLAuth", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.pb.validate.go#L39-L94
147,055
envoyproxy/go-control-plane
envoy/data/tap/v2alpha/common.pb.validate.go
Validate
func (m *Body) Validate() error { if m == nil { return nil } // no validation rules for Truncated switch m.BodyType.(type) { case *Body_AsBytes: // no validation rules for AsBytes case *Body_AsString: // no validation rules for AsString } return nil }
go
func (m *Body) Validate() error { if m == nil { return nil } // no validation rules for Truncated switch m.BodyType.(type) { case *Body_AsBytes: // no validation rules for AsBytes case *Body_AsString: // no validation rules for AsString } return nil }
[ "func", "(", "m", "*", "Body", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Truncated", "switch", "m", ".", "BodyType", ".", "(", "type", ")", "{", "case", "*", "Body_AsBytes", ":", "// no validation rules for AsBytes", "case", "*", "Body_AsString", ":", "// no validation rules for AsString", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Body with the rules defined in the proto // definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Body", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/data/tap/v2alpha/common.pb.validate.go#L38-L56
147,056
envoyproxy/go-control-plane
envoy/type/matcher/metadata.pb.validate.go
Validate
func (m *MetadataMatcher) Validate() error { if m == nil { return nil } if len(m.GetFilter()) < 1 { return MetadataMatcherValidationError{ field: "Filter", reason: "value length must be at least 1 bytes", } } if len(m.GetPath()) < 1 { return MetadataMatcherValidationError{ field: "Path", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetPath() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MetadataMatcherValidationError{ field: fmt.Sprintf("Path[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } if m.GetValue() == nil { return MetadataMatcherValidationError{ field: "Value", reason: "value is required", } } { tmp := m.GetValue() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MetadataMatcherValidationError{ field: "Value", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *MetadataMatcher) Validate() error { if m == nil { return nil } if len(m.GetFilter()) < 1 { return MetadataMatcherValidationError{ field: "Filter", reason: "value length must be at least 1 bytes", } } if len(m.GetPath()) < 1 { return MetadataMatcherValidationError{ field: "Path", reason: "value must contain at least 1 item(s)", } } for idx, item := range m.GetPath() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MetadataMatcherValidationError{ field: fmt.Sprintf("Path[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } if m.GetValue() == nil { return MetadataMatcherValidationError{ field: "Value", reason: "value is required", } } { tmp := m.GetValue() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MetadataMatcherValidationError{ field: "Value", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "MetadataMatcher", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetFilter", "(", ")", ")", "<", "1", "{", "return", "MetadataMatcherValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetPath", "(", ")", ")", "<", "1", "{", "return", "MetadataMatcherValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetPath", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "MetadataMatcherValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "m", ".", "GetValue", "(", ")", "==", "nil", "{", "return", "MetadataMatcherValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetValue", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "MetadataMatcherValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on MetadataMatcher with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "MetadataMatcher", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/type/matcher/metadata.pb.validate.go#L39-L101
147,057
envoyproxy/go-control-plane
envoy/type/matcher/metadata.pb.validate.go
Validate
func (m *MetadataMatcher_PathSegment) Validate() error { if m == nil { return nil } switch m.Segment.(type) { case *MetadataMatcher_PathSegment_Key: if len(m.GetKey()) < 1 { return MetadataMatcher_PathSegmentValidationError{ field: "Key", reason: "value length must be at least 1 bytes", } } default: return MetadataMatcher_PathSegmentValidationError{ field: "Segment", reason: "value is required", } } return nil }
go
func (m *MetadataMatcher_PathSegment) Validate() error { if m == nil { return nil } switch m.Segment.(type) { case *MetadataMatcher_PathSegment_Key: if len(m.GetKey()) < 1 { return MetadataMatcher_PathSegmentValidationError{ field: "Key", reason: "value length must be at least 1 bytes", } } default: return MetadataMatcher_PathSegmentValidationError{ field: "Segment", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "MetadataMatcher_PathSegment", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "Segment", ".", "(", "type", ")", "{", "case", "*", "MetadataMatcher_PathSegment_Key", ":", "if", "len", "(", "m", ".", "GetKey", "(", ")", ")", "<", "1", "{", "return", "MetadataMatcher_PathSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "default", ":", "return", "MetadataMatcher_PathSegmentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on MetadataMatcher_PathSegment with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "MetadataMatcher_PathSegment", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/type/matcher/metadata.pb.validate.go#L160-L185
147,058
envoyproxy/go-control-plane
envoy/service/ratelimit/v2/rls.pb.validate.go
Validate
func (m *RateLimitRequest) Validate() error { if m == nil { return nil } // no validation rules for Domain for idx, item := range m.GetDescriptors() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitRequestValidationError{ field: fmt.Sprintf("Descriptors[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for HitsAddend return nil }
go
func (m *RateLimitRequest) Validate() error { if m == nil { return nil } // no validation rules for Domain for idx, item := range m.GetDescriptors() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitRequestValidationError{ field: fmt.Sprintf("Descriptors[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for HitsAddend return nil }
[ "func", "(", "m", "*", "RateLimitRequest", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Domain", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetDescriptors", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RateLimitRequestValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for HitsAddend", "return", "nil", "\n", "}" ]
// Validate checks the field values on RateLimitRequest with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RateLimitRequest", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/service/ratelimit/v2/rls.pb.validate.go#L39-L69
147,059
envoyproxy/go-control-plane
envoy/service/ratelimit/v2/rls.pb.validate.go
Validate
func (m *RateLimitResponse) Validate() error { if m == nil { return nil } // no validation rules for OverallCode for idx, item := range m.GetStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitResponseValidationError{ field: fmt.Sprintf("Statuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitResponseValidationError{ field: fmt.Sprintf("Headers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *RateLimitResponse) Validate() error { if m == nil { return nil } // no validation rules for OverallCode for idx, item := range m.GetStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitResponseValidationError{ field: fmt.Sprintf("Statuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } for idx, item := range m.GetHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitResponseValidationError{ field: fmt.Sprintf("Headers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "RateLimitResponse", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for OverallCode", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetStatuses", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RateLimitResponseValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetHeaders", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RateLimitResponseValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on RateLimitResponse with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RateLimitResponse", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/service/ratelimit/v2/rls.pb.validate.go#L128-L176
147,060
envoyproxy/go-control-plane
envoy/service/ratelimit/v2/rls.pb.validate.go
Validate
func (m *RateLimitResponse_DescriptorStatus) Validate() error { if m == nil { return nil } // no validation rules for Code { tmp := m.GetCurrentLimit() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitResponse_DescriptorStatusValidationError{ field: "CurrentLimit", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for LimitRemaining return nil }
go
func (m *RateLimitResponse_DescriptorStatus) Validate() error { if m == nil { return nil } // no validation rules for Code { tmp := m.GetCurrentLimit() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RateLimitResponse_DescriptorStatusValidationError{ field: "CurrentLimit", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for LimitRemaining return nil }
[ "func", "(", "m", "*", "RateLimitResponse_DescriptorStatus", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Code", "{", "tmp", ":=", "m", ".", "GetCurrentLimit", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RateLimitResponse_DescriptorStatusValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for LimitRemaining", "return", "nil", "\n", "}" ]
// Validate checks the field values on RateLimitResponse_DescriptorStatus with // the rules defined in the proto definition for this message. If any rules // are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RateLimitResponse_DescriptorStatus", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/service/ratelimit/v2/rls.pb.validate.go#L309-L334
147,061
envoyproxy/go-control-plane
envoy/config/filter/http/gzip/v2/gzip.pb.validate.go
Validate
func (m *Gzip) Validate() error { if m == nil { return nil } if wrapper := m.GetMemoryLevel(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 9 { return GzipValidationError{ field: "MemoryLevel", reason: "value must be inside range [1, 9]", } } } if wrapper := m.GetContentLength(); wrapper != nil { if wrapper.GetValue() < 30 { return GzipValidationError{ field: "ContentLength", reason: "value must be greater than or equal to 30", } } } if _, ok := Gzip_CompressionLevel_Enum_name[int32(m.GetCompressionLevel())]; !ok { return GzipValidationError{ field: "CompressionLevel", reason: "value must be one of the defined enum values", } } if _, ok := Gzip_CompressionStrategy_name[int32(m.GetCompressionStrategy())]; !ok { return GzipValidationError{ field: "CompressionStrategy", reason: "value must be one of the defined enum values", } } if len(m.GetContentType()) > 50 { return GzipValidationError{ field: "ContentType", reason: "value must contain no more than 50 item(s)", } } // no validation rules for DisableOnEtagHeader // no validation rules for RemoveAcceptEncodingHeader if wrapper := m.GetWindowBits(); wrapper != nil { if val := wrapper.GetValue(); val < 9 || val > 15 { return GzipValidationError{ field: "WindowBits", reason: "value must be inside range [9, 15]", } } } return nil }
go
func (m *Gzip) Validate() error { if m == nil { return nil } if wrapper := m.GetMemoryLevel(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 9 { return GzipValidationError{ field: "MemoryLevel", reason: "value must be inside range [1, 9]", } } } if wrapper := m.GetContentLength(); wrapper != nil { if wrapper.GetValue() < 30 { return GzipValidationError{ field: "ContentLength", reason: "value must be greater than or equal to 30", } } } if _, ok := Gzip_CompressionLevel_Enum_name[int32(m.GetCompressionLevel())]; !ok { return GzipValidationError{ field: "CompressionLevel", reason: "value must be one of the defined enum values", } } if _, ok := Gzip_CompressionStrategy_name[int32(m.GetCompressionStrategy())]; !ok { return GzipValidationError{ field: "CompressionStrategy", reason: "value must be one of the defined enum values", } } if len(m.GetContentType()) > 50 { return GzipValidationError{ field: "ContentType", reason: "value must contain no more than 50 item(s)", } } // no validation rules for DisableOnEtagHeader // no validation rules for RemoveAcceptEncodingHeader if wrapper := m.GetWindowBits(); wrapper != nil { if val := wrapper.GetValue(); val < 9 || val > 15 { return GzipValidationError{ field: "WindowBits", reason: "value must be inside range [9, 15]", } } } return nil }
[ "func", "(", "m", "*", "Gzip", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetMemoryLevel", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "1", "||", "val", ">", "9", "{", "return", "GzipValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetContentLength", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "wrapper", ".", "GetValue", "(", ")", "<", "30", "{", "return", "GzipValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "Gzip_CompressionLevel_Enum_name", "[", "int32", "(", "m", ".", "GetCompressionLevel", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "GzipValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "_", ",", "ok", ":=", "Gzip_CompressionStrategy_name", "[", "int32", "(", "m", ".", "GetCompressionStrategy", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "GzipValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetContentType", "(", ")", ")", ">", "50", "{", "return", "GzipValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for DisableOnEtagHeader", "// no validation rules for RemoveAcceptEncodingHeader", "if", "wrapper", ":=", "m", ".", "GetWindowBits", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "9", "||", "val", ">", "15", "{", "return", "GzipValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Gzip with the rules defined in the proto // definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Gzip", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/gzip/v2/gzip.pb.validate.go#L38-L102
147,062
envoyproxy/go-control-plane
envoy/config/filter/http/fault/v2/fault.pb.validate.go
Validate
func (m *FaultAbort) Validate() error { if m == nil { return nil } { tmp := m.GetPercentage() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FaultAbortValidationError{ field: "Percentage", reason: "embedded message failed validation", cause: err, } } } } switch m.ErrorType.(type) { case *FaultAbort_HttpStatus: if val := m.GetHttpStatus(); val < 200 || val >= 600 { return FaultAbortValidationError{ field: "HttpStatus", reason: "value must be inside range [200, 600)", } } default: return FaultAbortValidationError{ field: "ErrorType", reason: "value is required", } } return nil }
go
func (m *FaultAbort) Validate() error { if m == nil { return nil } { tmp := m.GetPercentage() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return FaultAbortValidationError{ field: "Percentage", reason: "embedded message failed validation", cause: err, } } } } switch m.ErrorType.(type) { case *FaultAbort_HttpStatus: if val := m.GetHttpStatus(); val < 200 || val >= 600 { return FaultAbortValidationError{ field: "HttpStatus", reason: "value must be inside range [200, 600)", } } default: return FaultAbortValidationError{ field: "ErrorType", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "FaultAbort", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetPercentage", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "FaultAbortValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "switch", "m", ".", "ErrorType", ".", "(", "type", ")", "{", "case", "*", "FaultAbort_HttpStatus", ":", "if", "val", ":=", "m", ".", "GetHttpStatus", "(", ")", ";", "val", "<", "200", "||", "val", ">=", "600", "{", "return", "FaultAbortValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "default", ":", "return", "FaultAbortValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on FaultAbort with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FaultAbort", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/fault/v2/fault.pb.validate.go#L38-L78
147,063
envoyproxy/go-control-plane
envoy/config/filter/http/fault/v2/fault.pb.validate.go
Validate
func (m *HTTPFault) Validate() error { if m == nil { return nil } { tmp := m.GetDelay() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "Delay", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAbort() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "Abort", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for UpstreamCluster for idx, item := range m.GetHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: fmt.Sprintf("Headers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetMaxActiveFaults() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "MaxActiveFaults", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetResponseRateLimit() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "ResponseRateLimit", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *HTTPFault) Validate() error { if m == nil { return nil } { tmp := m.GetDelay() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "Delay", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAbort() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "Abort", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for UpstreamCluster for idx, item := range m.GetHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: fmt.Sprintf("Headers[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetMaxActiveFaults() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "MaxActiveFaults", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetResponseRateLimit() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HTTPFaultValidationError{ field: "ResponseRateLimit", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "HTTPFault", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetDelay", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HTTPFaultValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAbort", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HTTPFaultValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for UpstreamCluster", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetHeaders", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HTTPFaultValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMaxActiveFaults", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HTTPFaultValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetResponseRateLimit", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HTTPFaultValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HTTPFault with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HTTPFault", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/fault/v2/fault.pb.validate.go#L136-L224
147,064
envoyproxy/go-control-plane
envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.pb.validate.go
Validate
func (m *MongoProxy) Validate() error { if m == nil { return nil } if len(m.GetStatPrefix()) < 1 { return MongoProxyValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } // no validation rules for AccessLog { tmp := m.GetDelay() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MongoProxyValidationError{ field: "Delay", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for EmitDynamicMetadata return nil }
go
func (m *MongoProxy) Validate() error { if m == nil { return nil } if len(m.GetStatPrefix()) < 1 { return MongoProxyValidationError{ field: "StatPrefix", reason: "value length must be at least 1 bytes", } } // no validation rules for AccessLog { tmp := m.GetDelay() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return MongoProxyValidationError{ field: "Delay", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for EmitDynamicMetadata return nil }
[ "func", "(", "m", "*", "MongoProxy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetStatPrefix", "(", ")", ")", "<", "1", "{", "return", "MongoProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for AccessLog", "{", "tmp", ":=", "m", ".", "GetDelay", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "MongoProxyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for EmitDynamicMetadata", "return", "nil", "\n", "}" ]
// Validate checks the field values on MongoProxy with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "MongoProxy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/network/mongo_proxy/v2/mongo_proxy.pb.validate.go#L38-L70
147,065
envoyproxy/go-control-plane
envoy/admin/v2alpha/clusters.pb.validate.go
Validate
func (m *Clusters) Validate() error { if m == nil { return nil } for idx, item := range m.GetClusterStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClustersValidationError{ field: fmt.Sprintf("ClusterStatuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *Clusters) Validate() error { if m == nil { return nil } for idx, item := range m.GetClusterStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClustersValidationError{ field: fmt.Sprintf("ClusterStatuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "Clusters", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetClusterStatuses", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClustersValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Clusters with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Clusters", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/admin/v2alpha/clusters.pb.validate.go#L42-L68
147,066
envoyproxy/go-control-plane
envoy/admin/v2alpha/clusters.pb.validate.go
Validate
func (m *ClusterStatus) Validate() error { if m == nil { return nil } // no validation rules for Name // no validation rules for AddedViaApi { tmp := m.GetSuccessRateEjectionThreshold() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatusValidationError{ field: "SuccessRateEjectionThreshold", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetHostStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatusValidationError{ field: fmt.Sprintf("HostStatuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *ClusterStatus) Validate() error { if m == nil { return nil } // no validation rules for Name // no validation rules for AddedViaApi { tmp := m.GetSuccessRateEjectionThreshold() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatusValidationError{ field: "SuccessRateEjectionThreshold", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetHostStatuses() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return ClusterStatusValidationError{ field: fmt.Sprintf("HostStatuses[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "ClusterStatus", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Name", "// no validation rules for AddedViaApi", "{", "tmp", ":=", "m", ".", "GetSuccessRateEjectionThreshold", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClusterStatusValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetHostStatuses", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "ClusterStatusValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on ClusterStatus with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "ClusterStatus", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/admin/v2alpha/clusters.pb.validate.go#L127-L172
147,067
envoyproxy/go-control-plane
envoy/admin/v2alpha/clusters.pb.validate.go
Validate
func (m *HostStatus) Validate() error { if m == nil { return nil } { tmp := m.GetAddress() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: "Address", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: fmt.Sprintf("Stats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetHealthStatus() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: "HealthStatus", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetSuccessRate() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: "SuccessRate", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for Weight return nil }
go
func (m *HostStatus) Validate() error { if m == nil { return nil } { tmp := m.GetAddress() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: "Address", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetStats() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: fmt.Sprintf("Stats[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetHealthStatus() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: "HealthStatus", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetSuccessRate() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HostStatusValidationError{ field: "SuccessRate", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for Weight return nil }
[ "func", "(", "m", "*", "HostStatus", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAddress", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HostStatusValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetStats", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HostStatusValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetHealthStatus", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HostStatusValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetSuccessRate", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HostStatusValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for Weight", "return", "nil", "\n", "}" ]
// Validate checks the field values on HostStatus with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HostStatus", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/admin/v2alpha/clusters.pb.validate.go#L230-L303
147,068
envoyproxy/go-control-plane
envoy/type/percent.pb.validate.go
Validate
func (m *Percent) Validate() error { if m == nil { return nil } if val := m.GetValue(); val < 0 || val > 100 { return PercentValidationError{ field: "Value", reason: "value must be inside range [0, 100]", } } return nil }
go
func (m *Percent) Validate() error { if m == nil { return nil } if val := m.GetValue(); val < 0 || val > 100 { return PercentValidationError{ field: "Value", reason: "value must be inside range [0, 100]", } } return nil }
[ "func", "(", "m", "*", "Percent", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "val", ":=", "m", ".", "GetValue", "(", ")", ";", "val", "<", "0", "||", "val", ">", "100", "{", "return", "PercentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Percent with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Percent", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/type/percent.pb.validate.go#L38-L51
147,069
envoyproxy/go-control-plane
envoy/type/percent.pb.validate.go
Validate
func (m *FractionalPercent) Validate() error { if m == nil { return nil } // no validation rules for Numerator if _, ok := FractionalPercent_DenominatorType_name[int32(m.GetDenominator())]; !ok { return FractionalPercentValidationError{ field: "Denominator", reason: "value must be one of the defined enum values", } } return nil }
go
func (m *FractionalPercent) Validate() error { if m == nil { return nil } // no validation rules for Numerator if _, ok := FractionalPercent_DenominatorType_name[int32(m.GetDenominator())]; !ok { return FractionalPercentValidationError{ field: "Denominator", reason: "value must be one of the defined enum values", } } return nil }
[ "func", "(", "m", "*", "FractionalPercent", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Numerator", "if", "_", ",", "ok", ":=", "FractionalPercent_DenominatorType_name", "[", "int32", "(", "m", ".", "GetDenominator", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "FractionalPercentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on FractionalPercent with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FractionalPercent", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/type/percent.pb.validate.go#L110-L125
147,070
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *JwtProvider) Validate() error { if m == nil { return nil } if len(m.GetIssuer()) < 1 { return JwtProviderValidationError{ field: "Issuer", reason: "value length must be at least 1 bytes", } } // no validation rules for Forward for idx, item := range m.GetFromHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtProviderValidationError{ field: fmt.Sprintf("FromHeaders[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for ForwardPayloadHeader // no validation rules for PayloadInMetadata switch m.JwksSourceSpecifier.(type) { case *JwtProvider_RemoteJwks: { tmp := m.GetRemoteJwks() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtProviderValidationError{ field: "RemoteJwks", reason: "embedded message failed validation", cause: err, } } } } case *JwtProvider_LocalJwks: { tmp := m.GetLocalJwks() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtProviderValidationError{ field: "LocalJwks", reason: "embedded message failed validation", cause: err, } } } } default: return JwtProviderValidationError{ field: "JwksSourceSpecifier", reason: "value is required", } } return nil }
go
func (m *JwtProvider) Validate() error { if m == nil { return nil } if len(m.GetIssuer()) < 1 { return JwtProviderValidationError{ field: "Issuer", reason: "value length must be at least 1 bytes", } } // no validation rules for Forward for idx, item := range m.GetFromHeaders() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtProviderValidationError{ field: fmt.Sprintf("FromHeaders[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for ForwardPayloadHeader // no validation rules for PayloadInMetadata switch m.JwksSourceSpecifier.(type) { case *JwtProvider_RemoteJwks: { tmp := m.GetRemoteJwks() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtProviderValidationError{ field: "RemoteJwks", reason: "embedded message failed validation", cause: err, } } } } case *JwtProvider_LocalJwks: { tmp := m.GetLocalJwks() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtProviderValidationError{ field: "LocalJwks", reason: "embedded message failed validation", cause: err, } } } } default: return JwtProviderValidationError{ field: "JwksSourceSpecifier", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "JwtProvider", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetIssuer", "(", ")", ")", "<", "1", "{", "return", "JwtProviderValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for Forward", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetFromHeaders", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtProviderValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for ForwardPayloadHeader", "// no validation rules for PayloadInMetadata", "switch", "m", ".", "JwksSourceSpecifier", ".", "(", "type", ")", "{", "case", "*", "JwtProvider_RemoteJwks", ":", "{", "tmp", ":=", "m", ".", "GetRemoteJwks", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtProviderValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "JwtProvider_LocalJwks", ":", "{", "tmp", ":=", "m", ".", "GetLocalJwks", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtProviderValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "default", ":", "return", "JwtProviderValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on JwtProvider with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "JwtProvider", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L39-L122
147,071
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *RemoteJwks) Validate() error { if m == nil { return nil } { tmp := m.GetHttpUri() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RemoteJwksValidationError{ field: "HttpUri", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetCacheDuration() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RemoteJwksValidationError{ field: "CacheDuration", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *RemoteJwks) Validate() error { if m == nil { return nil } { tmp := m.GetHttpUri() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RemoteJwksValidationError{ field: "HttpUri", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetCacheDuration() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RemoteJwksValidationError{ field: "CacheDuration", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "RemoteJwks", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetHttpUri", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RemoteJwksValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetCacheDuration", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RemoteJwksValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on RemoteJwks with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RemoteJwks", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L180-L216
147,072
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *JwtHeader) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return JwtHeaderValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } // no validation rules for ValuePrefix return nil }
go
func (m *JwtHeader) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return JwtHeaderValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } // no validation rules for ValuePrefix return nil }
[ "func", "(", "m", "*", "JwtHeader", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "JwtHeaderValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for ValuePrefix", "return", "nil", "\n", "}" ]
// Validate checks the field values on JwtHeader with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "JwtHeader", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L274-L289
147,073
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *JwtRequirement) Validate() error { if m == nil { return nil } switch m.RequiresType.(type) { case *JwtRequirement_ProviderName: // no validation rules for ProviderName case *JwtRequirement_ProviderAndAudiences: { tmp := m.GetProviderAndAudiences() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "ProviderAndAudiences", reason: "embedded message failed validation", cause: err, } } } } case *JwtRequirement_RequiresAny: { tmp := m.GetRequiresAny() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "RequiresAny", reason: "embedded message failed validation", cause: err, } } } } case *JwtRequirement_RequiresAll: { tmp := m.GetRequiresAll() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "RequiresAll", reason: "embedded message failed validation", cause: err, } } } } case *JwtRequirement_AllowMissingOrFailed: { tmp := m.GetAllowMissingOrFailed() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "AllowMissingOrFailed", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *JwtRequirement) Validate() error { if m == nil { return nil } switch m.RequiresType.(type) { case *JwtRequirement_ProviderName: // no validation rules for ProviderName case *JwtRequirement_ProviderAndAudiences: { tmp := m.GetProviderAndAudiences() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "ProviderAndAudiences", reason: "embedded message failed validation", cause: err, } } } } case *JwtRequirement_RequiresAny: { tmp := m.GetRequiresAny() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "RequiresAny", reason: "embedded message failed validation", cause: err, } } } } case *JwtRequirement_RequiresAll: { tmp := m.GetRequiresAll() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "RequiresAll", reason: "embedded message failed validation", cause: err, } } } } case *JwtRequirement_AllowMissingOrFailed: { tmp := m.GetAllowMissingOrFailed() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementValidationError{ field: "AllowMissingOrFailed", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "JwtRequirement", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "RequiresType", ".", "(", "type", ")", "{", "case", "*", "JwtRequirement_ProviderName", ":", "// no validation rules for ProviderName", "case", "*", "JwtRequirement_ProviderAndAudiences", ":", "{", "tmp", ":=", "m", ".", "GetProviderAndAudiences", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtRequirementValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "JwtRequirement_RequiresAny", ":", "{", "tmp", ":=", "m", ".", "GetRequiresAny", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtRequirementValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "JwtRequirement_RequiresAll", ":", "{", "tmp", ":=", "m", ".", "GetRequiresAll", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtRequirementValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "JwtRequirement_AllowMissingOrFailed", ":", "{", "tmp", ":=", "m", ".", "GetAllowMissingOrFailed", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtRequirementValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on JwtRequirement with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "JwtRequirement", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L417-L498
147,074
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *JwtRequirementAndList) Validate() error { if m == nil { return nil } if len(m.GetRequirements()) < 2 { return JwtRequirementAndListValidationError{ field: "Requirements", reason: "value must contain at least 2 item(s)", } } for idx, item := range m.GetRequirements() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementAndListValidationError{ field: fmt.Sprintf("Requirements[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *JwtRequirementAndList) Validate() error { if m == nil { return nil } if len(m.GetRequirements()) < 2 { return JwtRequirementAndListValidationError{ field: "Requirements", reason: "value must contain at least 2 item(s)", } } for idx, item := range m.GetRequirements() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtRequirementAndListValidationError{ field: fmt.Sprintf("Requirements[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "JwtRequirementAndList", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetRequirements", "(", ")", ")", "<", "2", "{", "return", "JwtRequirementAndListValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRequirements", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtRequirementAndListValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on JwtRequirementAndList with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "JwtRequirementAndList", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L651-L684
147,075
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *RequirementRule) Validate() error { if m == nil { return nil } if m.GetMatch() == nil { return RequirementRuleValidationError{ field: "Match", reason: "value is required", } } { tmp := m.GetMatch() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RequirementRuleValidationError{ field: "Match", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetRequires() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RequirementRuleValidationError{ field: "Requires", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *RequirementRule) Validate() error { if m == nil { return nil } if m.GetMatch() == nil { return RequirementRuleValidationError{ field: "Match", reason: "value is required", } } { tmp := m.GetMatch() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RequirementRuleValidationError{ field: "Match", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetRequires() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RequirementRuleValidationError{ field: "Requires", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "RequirementRule", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetMatch", "(", ")", "==", "nil", "{", "return", "RequirementRuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetMatch", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RequirementRuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetRequires", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RequirementRuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on RequirementRule with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RequirementRule", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L745-L788
147,076
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *FilterStateRule) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return FilterStateRuleValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } // no validation rules for Requires return nil }
go
func (m *FilterStateRule) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return FilterStateRuleValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } // no validation rules for Requires return nil }
[ "func", "(", "m", "*", "FilterStateRule", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "FilterStateRuleValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for Requires", "return", "nil", "\n", "}" ]
// Validate checks the field values on FilterStateRule with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "FilterStateRule", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L847-L862
147,077
envoyproxy/go-control-plane
envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go
Validate
func (m *JwtAuthentication) Validate() error { if m == nil { return nil } // no validation rules for Providers for idx, item := range m.GetRules() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtAuthenticationValidationError{ field: fmt.Sprintf("Rules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetFilterStateRules() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtAuthenticationValidationError{ field: "FilterStateRules", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *JwtAuthentication) Validate() error { if m == nil { return nil } // no validation rules for Providers for idx, item := range m.GetRules() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtAuthenticationValidationError{ field: fmt.Sprintf("Rules[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } { tmp := m.GetFilterStateRules() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return JwtAuthenticationValidationError{ field: "FilterStateRules", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "JwtAuthentication", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Providers", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRules", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtAuthenticationValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetFilterStateRules", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "JwtAuthenticationValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on JwtAuthentication with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "JwtAuthentication", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/config/filter/http/jwt_authn/v2alpha/config.pb.validate.go#L921-L964
147,078
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *Node) Validate() error { if m == nil { return nil } // no validation rules for Id // no validation rules for Cluster { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return NodeValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetLocality() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return NodeValidationError{ field: "Locality", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for BuildVersion return nil }
go
func (m *Node) Validate() error { if m == nil { return nil } // no validation rules for Id // no validation rules for Cluster { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return NodeValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetLocality() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return NodeValidationError{ field: "Locality", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for BuildVersion return nil }
[ "func", "(", "m", "*", "Node", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Id", "// no validation rules for Cluster", "{", "tmp", ":=", "m", ".", "GetMetadata", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "NodeValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetLocality", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "NodeValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for BuildVersion", "return", "nil", "\n", "}" ]
// Validate checks the field values on Node with the rules defined in the proto // definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Node", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L108-L150
147,079
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *RuntimeUInt32) Validate() error { if m == nil { return nil } // no validation rules for DefaultValue if len(m.GetRuntimeKey()) < 1 { return RuntimeUInt32ValidationError{ field: "RuntimeKey", reason: "value length must be at least 1 bytes", } } return nil }
go
func (m *RuntimeUInt32) Validate() error { if m == nil { return nil } // no validation rules for DefaultValue if len(m.GetRuntimeKey()) < 1 { return RuntimeUInt32ValidationError{ field: "RuntimeKey", reason: "value length must be at least 1 bytes", } } return nil }
[ "func", "(", "m", "*", "RuntimeUInt32", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for DefaultValue", "if", "len", "(", "m", ".", "GetRuntimeKey", "(", ")", ")", "<", "1", "{", "return", "RuntimeUInt32ValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on RuntimeUInt32 with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RuntimeUInt32", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L275-L290
147,080
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *HeaderValue) Validate() error { if m == nil { return nil } if l := len(m.GetKey()); l < 1 || l > 16384 { return HeaderValueValidationError{ field: "Key", reason: "value length must be between 1 and 16384 bytes, inclusive", } } if len(m.GetValue()) > 16384 { return HeaderValueValidationError{ field: "Value", reason: "value length must be at most 16384 bytes", } } return nil }
go
func (m *HeaderValue) Validate() error { if m == nil { return nil } if l := len(m.GetKey()); l < 1 || l > 16384 { return HeaderValueValidationError{ field: "Key", reason: "value length must be between 1 and 16384 bytes, inclusive", } } if len(m.GetValue()) > 16384 { return HeaderValueValidationError{ field: "Value", reason: "value length must be at most 16384 bytes", } } return nil }
[ "func", "(", "m", "*", "HeaderValue", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "l", ":=", "len", "(", "m", ".", "GetKey", "(", ")", ")", ";", "l", "<", "1", "||", "l", ">", "16384", "{", "return", "HeaderValueValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetValue", "(", ")", ")", ">", "16384", "{", "return", "HeaderValueValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HeaderValue with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HeaderValue", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L349-L369
147,081
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *HeaderValueOption) Validate() error { if m == nil { return nil } if m.GetHeader() == nil { return HeaderValueOptionValidationError{ field: "Header", reason: "value is required", } } { tmp := m.GetHeader() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HeaderValueOptionValidationError{ field: "Header", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAppend() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HeaderValueOptionValidationError{ field: "Append", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *HeaderValueOption) Validate() error { if m == nil { return nil } if m.GetHeader() == nil { return HeaderValueOptionValidationError{ field: "Header", reason: "value is required", } } { tmp := m.GetHeader() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HeaderValueOptionValidationError{ field: "Header", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetAppend() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HeaderValueOptionValidationError{ field: "Append", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "HeaderValueOption", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetHeader", "(", ")", "==", "nil", "{", "return", "HeaderValueOptionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetHeader", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HeaderValueOptionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAppend", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HeaderValueOptionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HeaderValueOption with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HeaderValueOption", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L428-L471
147,082
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Error
func (e HeaderMapValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) } key := "" if e.key { key = "key for " } return fmt.Sprintf( "invalid %sHeaderMap.%s: %s%s", key, e.field, e.reason, cause) }
go
func (e HeaderMapValidationError) Error() string { cause := "" if e.cause != nil { cause = fmt.Sprintf(" | caused by: %v", e.cause) } key := "" if e.key { key = "key for " } return fmt.Sprintf( "invalid %sHeaderMap.%s: %s%s", key, e.field, e.reason, cause) }
[ "func", "(", "e", "HeaderMapValidationError", ")", "Error", "(", ")", "string", "{", "cause", ":=", "\"", "\"", "\n", "if", "e", ".", "cause", "!=", "nil", "{", "cause", "=", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "e", ".", "cause", ")", "\n", "}", "\n\n", "key", ":=", "\"", "\"", "\n", "if", "e", ".", "key", "{", "key", "=", "\"", "\"", "\n", "}", "\n\n", "return", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "key", ",", "e", ".", "field", ",", "e", ".", "reason", ",", "cause", ")", "\n", "}" ]
// Error satisfies the builtin error interface
[ "Error", "satisfies", "the", "builtin", "error", "interface" ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L584-L601
147,083
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *DataSource) Validate() error { if m == nil { return nil } switch m.Specifier.(type) { case *DataSource_Filename: if len(m.GetFilename()) < 1 { return DataSourceValidationError{ field: "Filename", reason: "value length must be at least 1 bytes", } } case *DataSource_InlineBytes: if len(m.GetInlineBytes()) < 1 { return DataSourceValidationError{ field: "InlineBytes", reason: "value length must be at least 1 bytes", } } case *DataSource_InlineString: if len(m.GetInlineString()) < 1 { return DataSourceValidationError{ field: "InlineString", reason: "value length must be at least 1 bytes", } } default: return DataSourceValidationError{ field: "Specifier", reason: "value is required", } } return nil }
go
func (m *DataSource) Validate() error { if m == nil { return nil } switch m.Specifier.(type) { case *DataSource_Filename: if len(m.GetFilename()) < 1 { return DataSourceValidationError{ field: "Filename", reason: "value length must be at least 1 bytes", } } case *DataSource_InlineBytes: if len(m.GetInlineBytes()) < 1 { return DataSourceValidationError{ field: "InlineBytes", reason: "value length must be at least 1 bytes", } } case *DataSource_InlineString: if len(m.GetInlineString()) < 1 { return DataSourceValidationError{ field: "InlineString", reason: "value length must be at least 1 bytes", } } default: return DataSourceValidationError{ field: "Specifier", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "DataSource", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "switch", "m", ".", "Specifier", ".", "(", "type", ")", "{", "case", "*", "DataSource_Filename", ":", "if", "len", "(", "m", ".", "GetFilename", "(", ")", ")", "<", "1", "{", "return", "DataSourceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "case", "*", "DataSource_InlineBytes", ":", "if", "len", "(", "m", ".", "GetInlineBytes", "(", ")", ")", "<", "1", "{", "return", "DataSourceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "case", "*", "DataSource_InlineString", ":", "if", "len", "(", "m", ".", "GetInlineString", "(", ")", ")", "<", "1", "{", "return", "DataSourceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "default", ":", "return", "DataSourceValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on DataSource with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "DataSource", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L615-L658
147,084
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *TransportSocket) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return TransportSocketValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *TransportSocket_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TransportSocketValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *TransportSocket_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TransportSocketValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *TransportSocket) Validate() error { if m == nil { return nil } if len(m.GetName()) < 1 { return TransportSocketValidationError{ field: "Name", reason: "value length must be at least 1 bytes", } } switch m.ConfigType.(type) { case *TransportSocket_Config: { tmp := m.GetConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TransportSocketValidationError{ field: "Config", reason: "embedded message failed validation", cause: err, } } } } case *TransportSocket_TypedConfig: { tmp := m.GetTypedConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return TransportSocketValidationError{ field: "TypedConfig", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "TransportSocket", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "len", "(", "m", ".", "GetName", "(", ")", ")", "<", "1", "{", "return", "TransportSocketValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "ConfigType", ".", "(", "type", ")", "{", "case", "*", "TransportSocket_Config", ":", "{", "tmp", ":=", "m", ".", "GetConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "TransportSocketValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "TransportSocket_TypedConfig", ":", "{", "tmp", ":=", "m", ".", "GetTypedConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "TransportSocketValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on TransportSocket with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "TransportSocket", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L717-L768
147,085
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *SocketOption) Validate() error { if m == nil { return nil } // no validation rules for Description // no validation rules for Level // no validation rules for Name if _, ok := SocketOption_SocketState_name[int32(m.GetState())]; !ok { return SocketOptionValidationError{ field: "State", reason: "value must be one of the defined enum values", } } switch m.Value.(type) { case *SocketOption_IntValue: // no validation rules for IntValue case *SocketOption_BufValue: // no validation rules for BufValue default: return SocketOptionValidationError{ field: "Value", reason: "value is required", } } return nil }
go
func (m *SocketOption) Validate() error { if m == nil { return nil } // no validation rules for Description // no validation rules for Level // no validation rules for Name if _, ok := SocketOption_SocketState_name[int32(m.GetState())]; !ok { return SocketOptionValidationError{ field: "State", reason: "value must be one of the defined enum values", } } switch m.Value.(type) { case *SocketOption_IntValue: // no validation rules for IntValue case *SocketOption_BufValue: // no validation rules for BufValue default: return SocketOptionValidationError{ field: "Value", reason: "value is required", } } return nil }
[ "func", "(", "m", "*", "SocketOption", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for Description", "// no validation rules for Level", "// no validation rules for Name", "if", "_", ",", "ok", ":=", "SocketOption_SocketState_name", "[", "int32", "(", "m", ".", "GetState", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "SocketOptionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "switch", "m", ".", "Value", ".", "(", "type", ")", "{", "case", "*", "SocketOption_IntValue", ":", "// no validation rules for IntValue", "case", "*", "SocketOption_BufValue", ":", "// no validation rules for BufValue", "default", ":", "return", "SocketOptionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on SocketOption with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "SocketOption", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L827-L862
147,086
envoyproxy/go-control-plane
envoy/api/v2/core/base.pb.validate.go
Validate
func (m *RuntimeFractionalPercent) Validate() error { if m == nil { return nil } if m.GetDefaultValue() == nil { return RuntimeFractionalPercentValidationError{ field: "DefaultValue", reason: "value is required", } } { tmp := m.GetDefaultValue() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RuntimeFractionalPercentValidationError{ field: "DefaultValue", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for RuntimeKey return nil }
go
func (m *RuntimeFractionalPercent) Validate() error { if m == nil { return nil } if m.GetDefaultValue() == nil { return RuntimeFractionalPercentValidationError{ field: "DefaultValue", reason: "value is required", } } { tmp := m.GetDefaultValue() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RuntimeFractionalPercentValidationError{ field: "DefaultValue", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for RuntimeKey return nil }
[ "func", "(", "m", "*", "RuntimeFractionalPercent", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetDefaultValue", "(", ")", "==", "nil", "{", "return", "RuntimeFractionalPercentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetDefaultValue", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RuntimeFractionalPercentValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for RuntimeKey", "return", "nil", "\n", "}" ]
// Validate checks the field values on RuntimeFractionalPercent with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RuntimeFractionalPercent", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/base.pb.validate.go#L921-L951
147,087
envoyproxy/go-control-plane
envoy/api/v2/endpoint/endpoint.pb.validate.go
Validate
func (m *Endpoint) Validate() error { if m == nil { return nil } { tmp := m.GetAddress() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EndpointValidationError{ field: "Address", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetHealthCheckConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EndpointValidationError{ field: "HealthCheckConfig", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *Endpoint) Validate() error { if m == nil { return nil } { tmp := m.GetAddress() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EndpointValidationError{ field: "Address", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetHealthCheckConfig() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return EndpointValidationError{ field: "HealthCheckConfig", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "Endpoint", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAddress", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "EndpointValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetHealthCheckConfig", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "EndpointValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Endpoint with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Endpoint", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/endpoint.pb.validate.go#L42-L78
147,088
envoyproxy/go-control-plane
envoy/api/v2/endpoint/endpoint.pb.validate.go
Validate
func (m *LbEndpoint) Validate() error { if m == nil { return nil } // no validation rules for HealthStatus { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LbEndpointValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } if wrapper := m.GetLoadBalancingWeight(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 128 { return LbEndpointValidationError{ field: "LoadBalancingWeight", reason: "value must be inside range [1, 128]", } } } switch m.HostIdentifier.(type) { case *LbEndpoint_Endpoint: { tmp := m.GetEndpoint() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LbEndpointValidationError{ field: "Endpoint", reason: "embedded message failed validation", cause: err, } } } } case *LbEndpoint_EndpointName: // no validation rules for EndpointName } return nil }
go
func (m *LbEndpoint) Validate() error { if m == nil { return nil } // no validation rules for HealthStatus { tmp := m.GetMetadata() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LbEndpointValidationError{ field: "Metadata", reason: "embedded message failed validation", cause: err, } } } } if wrapper := m.GetLoadBalancingWeight(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 128 { return LbEndpointValidationError{ field: "LoadBalancingWeight", reason: "value must be inside range [1, 128]", } } } switch m.HostIdentifier.(type) { case *LbEndpoint_Endpoint: { tmp := m.GetEndpoint() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LbEndpointValidationError{ field: "Endpoint", reason: "embedded message failed validation", cause: err, } } } } case *LbEndpoint_EndpointName: // no validation rules for EndpointName } return nil }
[ "func", "(", "m", "*", "LbEndpoint", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for HealthStatus", "{", "tmp", ":=", "m", ".", "GetMetadata", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "LbEndpointValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetLoadBalancingWeight", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "1", "||", "val", ">", "128", "{", "return", "LbEndpointValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "switch", "m", ".", "HostIdentifier", ".", "(", "type", ")", "{", "case", "*", "LbEndpoint_Endpoint", ":", "{", "tmp", ":=", "m", ".", "GetEndpoint", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "LbEndpointValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "LbEndpoint_EndpointName", ":", "// no validation rules for EndpointName", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on LbEndpoint with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "LbEndpoint", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/endpoint.pb.validate.go#L136-L194
147,089
envoyproxy/go-control-plane
envoy/api/v2/endpoint/endpoint.pb.validate.go
Validate
func (m *LocalityLbEndpoints) Validate() error { if m == nil { return nil } { tmp := m.GetLocality() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LocalityLbEndpointsValidationError{ field: "Locality", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetLbEndpoints() { _, _ = idx, item { tmp := item if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LocalityLbEndpointsValidationError{ field: fmt.Sprintf("LbEndpoints[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } if wrapper := m.GetLoadBalancingWeight(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 128 { return LocalityLbEndpointsValidationError{ field: "LoadBalancingWeight", reason: "value must be inside range [1, 128]", } } } if m.GetPriority() > 128 { return LocalityLbEndpointsValidationError{ field: "Priority", reason: "value must be less than or equal to 128", } } return nil }
go
func (m *LocalityLbEndpoints) Validate() error { if m == nil { return nil } { tmp := m.GetLocality() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LocalityLbEndpointsValidationError{ field: "Locality", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetLbEndpoints() { _, _ = idx, item { tmp := item if v, ok := interface{}(&tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return LocalityLbEndpointsValidationError{ field: fmt.Sprintf("LbEndpoints[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } if wrapper := m.GetLoadBalancingWeight(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 128 { return LocalityLbEndpointsValidationError{ field: "LoadBalancingWeight", reason: "value must be inside range [1, 128]", } } } if m.GetPriority() > 128 { return LocalityLbEndpointsValidationError{ field: "Priority", reason: "value must be less than or equal to 128", } } return nil }
[ "func", "(", "m", "*", "LocalityLbEndpoints", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetLocality", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "LocalityLbEndpointsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetLbEndpoints", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "&", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "LocalityLbEndpointsValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetLoadBalancingWeight", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "1", "||", "val", ">", "128", "{", "return", "LocalityLbEndpointsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "m", ".", "GetPriority", "(", ")", ">", "128", "{", "return", "LocalityLbEndpointsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on LocalityLbEndpoints with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "LocalityLbEndpoints", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/endpoint.pb.validate.go#L253-L312
147,090
envoyproxy/go-control-plane
envoy/api/v2/endpoint/endpoint.pb.validate.go
Validate
func (m *Endpoint_HealthCheckConfig) Validate() error { if m == nil { return nil } if m.GetPortValue() > 65535 { return Endpoint_HealthCheckConfigValidationError{ field: "PortValue", reason: "value must be less than or equal to 65535", } } return nil }
go
func (m *Endpoint_HealthCheckConfig) Validate() error { if m == nil { return nil } if m.GetPortValue() > 65535 { return Endpoint_HealthCheckConfigValidationError{ field: "PortValue", reason: "value must be less than or equal to 65535", } } return nil }
[ "func", "(", "m", "*", "Endpoint_HealthCheckConfig", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "m", ".", "GetPortValue", "(", ")", ">", "65535", "{", "return", "Endpoint_HealthCheckConfigValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on Endpoint_HealthCheckConfig with the // rules defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Endpoint_HealthCheckConfig", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/endpoint/endpoint.pb.validate.go#L373-L386
147,091
envoyproxy/go-control-plane
envoy/api/v2/core/protocol.pb.validate.go
Validate
func (m *HttpProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetIdleTimeout() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpProtocolOptionsValidationError{ field: "IdleTimeout", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *HttpProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetIdleTimeout() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HttpProtocolOptionsValidationError{ field: "IdleTimeout", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "HttpProtocolOptions", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetIdleTimeout", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HttpProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on HttpProtocolOptions with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HttpProtocolOptions", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/protocol.pb.validate.go#L106-L127
147,092
envoyproxy/go-control-plane
envoy/api/v2/core/protocol.pb.validate.go
Validate
func (m *Http1ProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetAllowAbsoluteUrl() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Http1ProtocolOptionsValidationError{ field: "AllowAbsoluteUrl", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for AcceptHttp_10 // no validation rules for DefaultHostForHttp_10 return nil }
go
func (m *Http1ProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetAllowAbsoluteUrl() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Http1ProtocolOptionsValidationError{ field: "AllowAbsoluteUrl", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for AcceptHttp_10 // no validation rules for DefaultHostForHttp_10 return nil }
[ "func", "(", "m", "*", "Http1ProtocolOptions", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAllowAbsoluteUrl", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "Http1ProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for AcceptHttp_10", "// no validation rules for DefaultHostForHttp_10", "return", "nil", "\n", "}" ]
// Validate checks the field values on Http1ProtocolOptions with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Http1ProtocolOptions", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/protocol.pb.validate.go#L188-L213
147,093
envoyproxy/go-control-plane
envoy/api/v2/core/protocol.pb.validate.go
Validate
func (m *Http2ProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetHpackTableSize() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Http2ProtocolOptionsValidationError{ field: "HpackTableSize", reason: "embedded message failed validation", cause: err, } } } } if wrapper := m.GetMaxConcurrentStreams(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 2147483647 { return Http2ProtocolOptionsValidationError{ field: "MaxConcurrentStreams", reason: "value must be inside range [1, 2147483647]", } } } if wrapper := m.GetInitialStreamWindowSize(); wrapper != nil { if val := wrapper.GetValue(); val < 65535 || val > 2147483647 { return Http2ProtocolOptionsValidationError{ field: "InitialStreamWindowSize", reason: "value must be inside range [65535, 2147483647]", } } } if wrapper := m.GetInitialConnectionWindowSize(); wrapper != nil { if val := wrapper.GetValue(); val < 65535 || val > 2147483647 { return Http2ProtocolOptionsValidationError{ field: "InitialConnectionWindowSize", reason: "value must be inside range [65535, 2147483647]", } } } // no validation rules for AllowConnect // no validation rules for AllowMetadata return nil }
go
func (m *Http2ProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetHpackTableSize() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return Http2ProtocolOptionsValidationError{ field: "HpackTableSize", reason: "embedded message failed validation", cause: err, } } } } if wrapper := m.GetMaxConcurrentStreams(); wrapper != nil { if val := wrapper.GetValue(); val < 1 || val > 2147483647 { return Http2ProtocolOptionsValidationError{ field: "MaxConcurrentStreams", reason: "value must be inside range [1, 2147483647]", } } } if wrapper := m.GetInitialStreamWindowSize(); wrapper != nil { if val := wrapper.GetValue(); val < 65535 || val > 2147483647 { return Http2ProtocolOptionsValidationError{ field: "InitialStreamWindowSize", reason: "value must be inside range [65535, 2147483647]", } } } if wrapper := m.GetInitialConnectionWindowSize(); wrapper != nil { if val := wrapper.GetValue(); val < 65535 || val > 2147483647 { return Http2ProtocolOptionsValidationError{ field: "InitialConnectionWindowSize", reason: "value must be inside range [65535, 2147483647]", } } } // no validation rules for AllowConnect // no validation rules for AllowMetadata return nil }
[ "func", "(", "m", "*", "Http2ProtocolOptions", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetHpackTableSize", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "Http2ProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetMaxConcurrentStreams", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "1", "||", "val", ">", "2147483647", "{", "return", "Http2ProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetInitialStreamWindowSize", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "65535", "||", "val", ">", "2147483647", "{", "return", "Http2ProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetInitialConnectionWindowSize", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "val", ":=", "wrapper", ".", "GetValue", "(", ")", ";", "val", "<", "65535", "||", "val", ">", "2147483647", "{", "return", "Http2ProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for AllowConnect", "// no validation rules for AllowMetadata", "return", "nil", "\n", "}" ]
// Validate checks the field values on Http2ProtocolOptions with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "Http2ProtocolOptions", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/protocol.pb.validate.go#L274-L332
147,094
envoyproxy/go-control-plane
envoy/api/v2/core/protocol.pb.validate.go
Validate
func (m *GrpcProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetHttp2ProtocolOptions() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GrpcProtocolOptionsValidationError{ field: "Http2ProtocolOptions", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *GrpcProtocolOptions) Validate() error { if m == nil { return nil } { tmp := m.GetHttp2ProtocolOptions() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return GrpcProtocolOptionsValidationError{ field: "Http2ProtocolOptions", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "GrpcProtocolOptions", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetHttp2ProtocolOptions", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "GrpcProtocolOptionsValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on GrpcProtocolOptions with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "GrpcProtocolOptions", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/core/protocol.pb.validate.go#L393-L414
147,095
envoyproxy/go-control-plane
envoy/api/v2/route/route.pb.validate.go
Validate
func (m *CorsPolicy) Validate() error { if m == nil { return nil } for idx, item := range m.GetAllowOriginRegex() { _, _ = idx, item if len(item) > 1024 { return CorsPolicyValidationError{ field: fmt.Sprintf("AllowOriginRegex[%v]", idx), reason: "value length must be at most 1024 bytes", } } } // no validation rules for AllowMethods // no validation rules for AllowHeaders // no validation rules for ExposeHeaders // no validation rules for MaxAge { tmp := m.GetAllowCredentials() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "AllowCredentials", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetShadowEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "ShadowEnabled", reason: "embedded message failed validation", cause: err, } } } } switch m.EnabledSpecifier.(type) { case *CorsPolicy_Enabled: { tmp := m.GetEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "Enabled", reason: "embedded message failed validation", cause: err, } } } } case *CorsPolicy_FilterEnabled: { tmp := m.GetFilterEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "FilterEnabled", reason: "embedded message failed validation", cause: err, } } } } } return nil }
go
func (m *CorsPolicy) Validate() error { if m == nil { return nil } for idx, item := range m.GetAllowOriginRegex() { _, _ = idx, item if len(item) > 1024 { return CorsPolicyValidationError{ field: fmt.Sprintf("AllowOriginRegex[%v]", idx), reason: "value length must be at most 1024 bytes", } } } // no validation rules for AllowMethods // no validation rules for AllowHeaders // no validation rules for ExposeHeaders // no validation rules for MaxAge { tmp := m.GetAllowCredentials() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "AllowCredentials", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetShadowEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "ShadowEnabled", reason: "embedded message failed validation", cause: err, } } } } switch m.EnabledSpecifier.(type) { case *CorsPolicy_Enabled: { tmp := m.GetEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "Enabled", reason: "embedded message failed validation", cause: err, } } } } case *CorsPolicy_FilterEnabled: { tmp := m.GetFilterEnabled() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return CorsPolicyValidationError{ field: "FilterEnabled", reason: "embedded message failed validation", cause: err, } } } } } return nil }
[ "func", "(", "m", "*", "CorsPolicy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetAllowOriginRegex", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "if", "len", "(", "item", ")", ">", "1024", "{", "return", "CorsPolicyValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for AllowMethods", "// no validation rules for AllowHeaders", "// no validation rules for ExposeHeaders", "// no validation rules for MaxAge", "{", "tmp", ":=", "m", ".", "GetAllowCredentials", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CorsPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetShadowEnabled", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CorsPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "switch", "m", ".", "EnabledSpecifier", ".", "(", "type", ")", "{", "case", "*", "CorsPolicy_Enabled", ":", "{", "tmp", ":=", "m", ".", "GetEnabled", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CorsPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "case", "*", "CorsPolicy_FilterEnabled", ":", "{", "tmp", ":=", "m", ".", "GetFilterEnabled", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "CorsPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on CorsPolicy with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "CorsPolicy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/route/route.pb.validate.go#L797-L891
147,096
envoyproxy/go-control-plane
envoy/api/v2/route/route.pb.validate.go
Validate
func (m *RetryPolicy) Validate() error { if m == nil { return nil } // no validation rules for RetryOn { tmp := m.GetNumRetries() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "NumRetries", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetPerTryTimeout() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "PerTryTimeout", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetRetryPriority() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "RetryPriority", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetRetryHostPredicate() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: fmt.Sprintf("RetryHostPredicate[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for HostSelectionRetryMaxAttempts { tmp := m.GetRetryBackOff() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "RetryBackOff", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *RetryPolicy) Validate() error { if m == nil { return nil } // no validation rules for RetryOn { tmp := m.GetNumRetries() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "NumRetries", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetPerTryTimeout() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "PerTryTimeout", reason: "embedded message failed validation", cause: err, } } } } { tmp := m.GetRetryPriority() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "RetryPriority", reason: "embedded message failed validation", cause: err, } } } } for idx, item := range m.GetRetryHostPredicate() { _, _ = idx, item { tmp := item if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: fmt.Sprintf("RetryHostPredicate[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } } // no validation rules for HostSelectionRetryMaxAttempts { tmp := m.GetRetryBackOff() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return RetryPolicyValidationError{ field: "RetryBackOff", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "RetryPolicy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for RetryOn", "{", "tmp", ":=", "m", ".", "GetNumRetries", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RetryPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetPerTryTimeout", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RetryPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetRetryPriority", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RetryPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "for", "idx", ",", "item", ":=", "range", "m", ".", "GetRetryHostPredicate", "(", ")", "{", "_", ",", "_", "=", "idx", ",", "item", "\n\n", "{", "tmp", ":=", "item", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RetryPolicyValidationError", "{", "field", ":", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "idx", ")", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "}", "\n\n", "// no validation rules for HostSelectionRetryMaxAttempts", "{", "tmp", ":=", "m", ".", "GetRetryBackOff", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "RetryPolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on RetryPolicy with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RetryPolicy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/route/route.pb.validate.go#L1307-L1397
147,097
envoyproxy/go-control-plane
envoy/api/v2/route/route.pb.validate.go
Validate
func (m *HedgePolicy) Validate() error { if m == nil { return nil } if wrapper := m.GetInitialRequests(); wrapper != nil { if wrapper.GetValue() < 1 { return HedgePolicyValidationError{ field: "InitialRequests", reason: "value must be greater than or equal to 1", } } } { tmp := m.GetAdditionalRequestChance() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HedgePolicyValidationError{ field: "AdditionalRequestChance", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for HedgeOnPerTryTimeout return nil }
go
func (m *HedgePolicy) Validate() error { if m == nil { return nil } if wrapper := m.GetInitialRequests(); wrapper != nil { if wrapper.GetValue() < 1 { return HedgePolicyValidationError{ field: "InitialRequests", reason: "value must be greater than or equal to 1", } } } { tmp := m.GetAdditionalRequestChance() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return HedgePolicyValidationError{ field: "AdditionalRequestChance", reason: "embedded message failed validation", cause: err, } } } } // no validation rules for HedgeOnPerTryTimeout return nil }
[ "func", "(", "m", "*", "HedgePolicy", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "wrapper", ":=", "m", ".", "GetInitialRequests", "(", ")", ";", "wrapper", "!=", "nil", "{", "if", "wrapper", ".", "GetValue", "(", ")", "<", "1", "{", "return", "HedgePolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetAdditionalRequestChance", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "HedgePolicyValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "// no validation rules for HedgeOnPerTryTimeout", "return", "nil", "\n", "}" ]
// Validate checks the field values on HedgePolicy with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "HedgePolicy", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/route/route.pb.validate.go#L1456-L1490
147,098
envoyproxy/go-control-plane
envoy/api/v2/route/route.pb.validate.go
Validate
func (m *RedirectAction) Validate() error { if m == nil { return nil } // no validation rules for HostRedirect // no validation rules for PortRedirect if _, ok := RedirectAction_RedirectResponseCode_name[int32(m.GetResponseCode())]; !ok { return RedirectActionValidationError{ field: "ResponseCode", reason: "value must be one of the defined enum values", } } // no validation rules for StripQuery switch m.SchemeRewriteSpecifier.(type) { case *RedirectAction_HttpsRedirect: // no validation rules for HttpsRedirect case *RedirectAction_SchemeRedirect: // no validation rules for SchemeRedirect } switch m.PathRewriteSpecifier.(type) { case *RedirectAction_PathRedirect: // no validation rules for PathRedirect case *RedirectAction_PrefixRewrite: // no validation rules for PrefixRewrite } return nil }
go
func (m *RedirectAction) Validate() error { if m == nil { return nil } // no validation rules for HostRedirect // no validation rules for PortRedirect if _, ok := RedirectAction_RedirectResponseCode_name[int32(m.GetResponseCode())]; !ok { return RedirectActionValidationError{ field: "ResponseCode", reason: "value must be one of the defined enum values", } } // no validation rules for StripQuery switch m.SchemeRewriteSpecifier.(type) { case *RedirectAction_HttpsRedirect: // no validation rules for HttpsRedirect case *RedirectAction_SchemeRedirect: // no validation rules for SchemeRedirect } switch m.PathRewriteSpecifier.(type) { case *RedirectAction_PathRedirect: // no validation rules for PathRedirect case *RedirectAction_PrefixRewrite: // no validation rules for PrefixRewrite } return nil }
[ "func", "(", "m", "*", "RedirectAction", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "// no validation rules for HostRedirect", "// no validation rules for PortRedirect", "if", "_", ",", "ok", ":=", "RedirectAction_RedirectResponseCode_name", "[", "int32", "(", "m", ".", "GetResponseCode", "(", ")", ")", "]", ";", "!", "ok", "{", "return", "RedirectActionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "// no validation rules for StripQuery", "switch", "m", ".", "SchemeRewriteSpecifier", ".", "(", "type", ")", "{", "case", "*", "RedirectAction_HttpsRedirect", ":", "// no validation rules for HttpsRedirect", "case", "*", "RedirectAction_SchemeRedirect", ":", "// no validation rules for SchemeRedirect", "}", "\n\n", "switch", "m", ".", "PathRewriteSpecifier", ".", "(", "type", ")", "{", "case", "*", "RedirectAction_PathRedirect", ":", "// no validation rules for PathRedirect", "case", "*", "RedirectAction_PrefixRewrite", ":", "// no validation rules for PrefixRewrite", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on RedirectAction with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned.
[ "Validate", "checks", "the", "field", "values", "on", "RedirectAction", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/route/route.pb.validate.go#L1549-L1588
147,099
envoyproxy/go-control-plane
envoy/api/v2/route/route.pb.validate.go
Validate
func (m *DirectResponseAction) Validate() error { if m == nil { return nil } if val := m.GetStatus(); val < 100 || val >= 600 { return DirectResponseActionValidationError{ field: "Status", reason: "value must be inside range [100, 600)", } } { tmp := m.GetBody() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DirectResponseActionValidationError{ field: "Body", reason: "embedded message failed validation", cause: err, } } } } return nil }
go
func (m *DirectResponseAction) Validate() error { if m == nil { return nil } if val := m.GetStatus(); val < 100 || val >= 600 { return DirectResponseActionValidationError{ field: "Status", reason: "value must be inside range [100, 600)", } } { tmp := m.GetBody() if v, ok := interface{}(tmp).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return DirectResponseActionValidationError{ field: "Body", reason: "embedded message failed validation", cause: err, } } } } return nil }
[ "func", "(", "m", "*", "DirectResponseAction", ")", "Validate", "(", ")", "error", "{", "if", "m", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "if", "val", ":=", "m", ".", "GetStatus", "(", ")", ";", "val", "<", "100", "||", "val", ">=", "600", "{", "return", "DirectResponseActionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "}", "\n", "}", "\n\n", "{", "tmp", ":=", "m", ".", "GetBody", "(", ")", "\n\n", "if", "v", ",", "ok", ":=", "interface", "{", "}", "(", "tmp", ")", ".", "(", "interface", "{", "Validate", "(", ")", "error", "}", ")", ";", "ok", "{", "if", "err", ":=", "v", ".", "Validate", "(", ")", ";", "err", "!=", "nil", "{", "return", "DirectResponseActionValidationError", "{", "field", ":", "\"", "\"", ",", "reason", ":", "\"", "\"", ",", "cause", ":", "err", ",", "}", "\n", "}", "\n", "}", "\n", "}", "\n\n", "return", "nil", "\n", "}" ]
// Validate checks the field values on DirectResponseAction with the rules // defined in the proto definition for this message. If any rules are // violated, an error is returned.
[ "Validate", "checks", "the", "field", "values", "on", "DirectResponseAction", "with", "the", "rules", "defined", "in", "the", "proto", "definition", "for", "this", "message", ".", "If", "any", "rules", "are", "violated", "an", "error", "is", "returned", "." ]
9ffbaf293221f9fef735838632a9109d00aa2f4c
https://github.com/envoyproxy/go-control-plane/blob/9ffbaf293221f9fef735838632a9109d00aa2f4c/envoy/api/v2/route/route.pb.validate.go#L1647-L1675