979 lines
26 KiB
Go
979 lines
26 KiB
Go
// Code generated by protoc-gen-validate. DO NOT EDIT.
|
|
// source: conf/v1/kratos_conf_config.proto
|
|
|
|
package conf
|
|
|
|
import (
|
|
"bytes"
|
|
"errors"
|
|
"fmt"
|
|
"net"
|
|
"net/mail"
|
|
"net/url"
|
|
"regexp"
|
|
"sort"
|
|
"strings"
|
|
"time"
|
|
"unicode/utf8"
|
|
|
|
"google.golang.org/protobuf/types/known/anypb"
|
|
)
|
|
|
|
// ensure the imports are used
|
|
var (
|
|
_ = bytes.MinRead
|
|
_ = errors.New("")
|
|
_ = fmt.Print
|
|
_ = utf8.UTFMax
|
|
_ = (*regexp.Regexp)(nil)
|
|
_ = (*strings.Reader)(nil)
|
|
_ = net.IPv4len
|
|
_ = time.Duration(0)
|
|
_ = (*url.URL)(nil)
|
|
_ = (*mail.Address)(nil)
|
|
_ = anypb.Any{}
|
|
_ = sort.Sort
|
|
)
|
|
|
|
// Validate checks the field values on RemoteConfig with the rules defined in
|
|
// the proto definition for this message. If any rules are violated, the first
|
|
// error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig with the rules defined
|
|
// in the proto definition for this message. If any rules are violated, the
|
|
// result is a list of violation errors wrapped in RemoteConfigMultiError, or
|
|
// nil if none found.
|
|
func (m *RemoteConfig) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
// no validation rules for Type
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetEtcd()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Etcd",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Etcd",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetEtcd()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfigValidationError{
|
|
field: "Etcd",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetConsul()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Consul",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Consul",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetConsul()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfigValidationError{
|
|
field: "Consul",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetNacos()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Nacos",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Nacos",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetNacos()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfigValidationError{
|
|
field: "Nacos",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetApollo()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Apollo",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Apollo",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetApollo()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfigValidationError{
|
|
field: "Apollo",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetKubernetes()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Kubernetes",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Kubernetes",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetKubernetes()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfigValidationError{
|
|
field: "Kubernetes",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetPolaris()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Polaris",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfigValidationError{
|
|
field: "Polaris",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetPolaris()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfigValidationError{
|
|
field: "Polaris",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfigMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfigMultiError is an error wrapping multiple validation errors
|
|
// returned by RemoteConfig.ValidateAll() if the designated constraints aren't met.
|
|
type RemoteConfigMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfigMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfigMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfigValidationError is the validation error returned by
|
|
// RemoteConfig.Validate if the designated constraints aren't met.
|
|
type RemoteConfigValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfigValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfigValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfigValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfigValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfigValidationError) ErrorName() string { return "RemoteConfigValidationError" }
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfigValidationError) 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 %sRemoteConfig.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfigValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfigValidationError{}
|
|
|
|
// Validate checks the field values on RemoteConfig_Nacos with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig_Nacos) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig_Nacos with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// RemoteConfig_NacosMultiError, or nil if none found.
|
|
func (m *RemoteConfig_Nacos) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig_Nacos) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
// no validation rules for Address
|
|
|
|
// no validation rules for Port
|
|
|
|
// no validation rules for Key
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfig_NacosMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfig_NacosMultiError is an error wrapping multiple validation errors
|
|
// returned by RemoteConfig_Nacos.ValidateAll() if the designated constraints
|
|
// aren't met.
|
|
type RemoteConfig_NacosMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfig_NacosMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfig_NacosMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfig_NacosValidationError is the validation error returned by
|
|
// RemoteConfig_Nacos.Validate if the designated constraints aren't met.
|
|
type RemoteConfig_NacosValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfig_NacosValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfig_NacosValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfig_NacosValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfig_NacosValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfig_NacosValidationError) ErrorName() string {
|
|
return "RemoteConfig_NacosValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfig_NacosValidationError) 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 %sRemoteConfig_Nacos.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfig_NacosValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfig_NacosValidationError{}
|
|
|
|
// Validate checks the field values on RemoteConfig_Etcd with the rules defined
|
|
// in the proto definition for this message. If any rules are violated, the
|
|
// first error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig_Etcd) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig_Etcd with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// RemoteConfig_EtcdMultiError, or nil if none found.
|
|
func (m *RemoteConfig_Etcd) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig_Etcd) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if all {
|
|
switch v := interface{}(m.GetTimeout()).(type) {
|
|
case interface{ ValidateAll() error }:
|
|
if err := v.ValidateAll(); err != nil {
|
|
errors = append(errors, RemoteConfig_EtcdValidationError{
|
|
field: "Timeout",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
case interface{ Validate() error }:
|
|
if err := v.Validate(); err != nil {
|
|
errors = append(errors, RemoteConfig_EtcdValidationError{
|
|
field: "Timeout",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
})
|
|
}
|
|
}
|
|
} else if v, ok := interface{}(m.GetTimeout()).(interface{ Validate() error }); ok {
|
|
if err := v.Validate(); err != nil {
|
|
return RemoteConfig_EtcdValidationError{
|
|
field: "Timeout",
|
|
reason: "embedded message failed validation",
|
|
cause: err,
|
|
}
|
|
}
|
|
}
|
|
|
|
// no validation rules for Key
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfig_EtcdMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfig_EtcdMultiError is an error wrapping multiple validation errors
|
|
// returned by RemoteConfig_Etcd.ValidateAll() if the designated constraints
|
|
// aren't met.
|
|
type RemoteConfig_EtcdMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfig_EtcdMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfig_EtcdMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfig_EtcdValidationError is the validation error returned by
|
|
// RemoteConfig_Etcd.Validate if the designated constraints aren't met.
|
|
type RemoteConfig_EtcdValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfig_EtcdValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfig_EtcdValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfig_EtcdValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfig_EtcdValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfig_EtcdValidationError) ErrorName() string {
|
|
return "RemoteConfig_EtcdValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfig_EtcdValidationError) 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 %sRemoteConfig_Etcd.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfig_EtcdValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfig_EtcdValidationError{}
|
|
|
|
// Validate checks the field values on RemoteConfig_Consul with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig_Consul) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig_Consul with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// RemoteConfig_ConsulMultiError, or nil if none found.
|
|
func (m *RemoteConfig_Consul) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig_Consul) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
// no validation rules for Scheme
|
|
|
|
// no validation rules for Address
|
|
|
|
// no validation rules for Key
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfig_ConsulMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfig_ConsulMultiError is an error wrapping multiple validation
|
|
// errors returned by RemoteConfig_Consul.ValidateAll() if the designated
|
|
// constraints aren't met.
|
|
type RemoteConfig_ConsulMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfig_ConsulMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfig_ConsulMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfig_ConsulValidationError is the validation error returned by
|
|
// RemoteConfig_Consul.Validate if the designated constraints aren't met.
|
|
type RemoteConfig_ConsulValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfig_ConsulValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfig_ConsulValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfig_ConsulValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfig_ConsulValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfig_ConsulValidationError) ErrorName() string {
|
|
return "RemoteConfig_ConsulValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfig_ConsulValidationError) 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 %sRemoteConfig_Consul.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfig_ConsulValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfig_ConsulValidationError{}
|
|
|
|
// Validate checks the field values on RemoteConfig_Apollo with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig_Apollo) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig_Apollo with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// RemoteConfig_ApolloMultiError, or nil if none found.
|
|
func (m *RemoteConfig_Apollo) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig_Apollo) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
// no validation rules for Endpoint
|
|
|
|
// no validation rules for AppId
|
|
|
|
// no validation rules for Cluster
|
|
|
|
// no validation rules for Namespace
|
|
|
|
// no validation rules for Secret
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfig_ApolloMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfig_ApolloMultiError is an error wrapping multiple validation
|
|
// errors returned by RemoteConfig_Apollo.ValidateAll() if the designated
|
|
// constraints aren't met.
|
|
type RemoteConfig_ApolloMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfig_ApolloMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfig_ApolloMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfig_ApolloValidationError is the validation error returned by
|
|
// RemoteConfig_Apollo.Validate if the designated constraints aren't met.
|
|
type RemoteConfig_ApolloValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfig_ApolloValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfig_ApolloValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfig_ApolloValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfig_ApolloValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfig_ApolloValidationError) ErrorName() string {
|
|
return "RemoteConfig_ApolloValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfig_ApolloValidationError) 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 %sRemoteConfig_Apollo.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfig_ApolloValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfig_ApolloValidationError{}
|
|
|
|
// Validate checks the field values on RemoteConfig_Kubernetes with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig_Kubernetes) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig_Kubernetes with the
|
|
// rules defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// RemoteConfig_KubernetesMultiError, or nil if none found.
|
|
func (m *RemoteConfig_Kubernetes) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig_Kubernetes) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
// no validation rules for Namespace
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfig_KubernetesMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfig_KubernetesMultiError is an error wrapping multiple validation
|
|
// errors returned by RemoteConfig_Kubernetes.ValidateAll() if the designated
|
|
// constraints aren't met.
|
|
type RemoteConfig_KubernetesMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfig_KubernetesMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfig_KubernetesMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfig_KubernetesValidationError is the validation error returned by
|
|
// RemoteConfig_Kubernetes.Validate if the designated constraints aren't met.
|
|
type RemoteConfig_KubernetesValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfig_KubernetesValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfig_KubernetesValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfig_KubernetesValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfig_KubernetesValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfig_KubernetesValidationError) ErrorName() string {
|
|
return "RemoteConfig_KubernetesValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfig_KubernetesValidationError) 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 %sRemoteConfig_Kubernetes.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfig_KubernetesValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfig_KubernetesValidationError{}
|
|
|
|
// Validate checks the field values on RemoteConfig_Polaris with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the first error encountered is returned, or nil if there are no violations.
|
|
func (m *RemoteConfig_Polaris) Validate() error {
|
|
return m.validate(false)
|
|
}
|
|
|
|
// ValidateAll checks the field values on RemoteConfig_Polaris with the rules
|
|
// defined in the proto definition for this message. If any rules are
|
|
// violated, the result is a list of violation errors wrapped in
|
|
// RemoteConfig_PolarisMultiError, or nil if none found.
|
|
func (m *RemoteConfig_Polaris) ValidateAll() error {
|
|
return m.validate(true)
|
|
}
|
|
|
|
func (m *RemoteConfig_Polaris) validate(all bool) error {
|
|
if m == nil {
|
|
return nil
|
|
}
|
|
|
|
var errors []error
|
|
|
|
if len(errors) > 0 {
|
|
return RemoteConfig_PolarisMultiError(errors)
|
|
}
|
|
|
|
return nil
|
|
}
|
|
|
|
// RemoteConfig_PolarisMultiError is an error wrapping multiple validation
|
|
// errors returned by RemoteConfig_Polaris.ValidateAll() if the designated
|
|
// constraints aren't met.
|
|
type RemoteConfig_PolarisMultiError []error
|
|
|
|
// Error returns a concatenation of all the error messages it wraps.
|
|
func (m RemoteConfig_PolarisMultiError) Error() string {
|
|
var msgs []string
|
|
for _, err := range m {
|
|
msgs = append(msgs, err.Error())
|
|
}
|
|
return strings.Join(msgs, "; ")
|
|
}
|
|
|
|
// AllErrors returns a list of validation violation errors.
|
|
func (m RemoteConfig_PolarisMultiError) AllErrors() []error { return m }
|
|
|
|
// RemoteConfig_PolarisValidationError is the validation error returned by
|
|
// RemoteConfig_Polaris.Validate if the designated constraints aren't met.
|
|
type RemoteConfig_PolarisValidationError struct {
|
|
field string
|
|
reason string
|
|
cause error
|
|
key bool
|
|
}
|
|
|
|
// Field function returns field value.
|
|
func (e RemoteConfig_PolarisValidationError) Field() string { return e.field }
|
|
|
|
// Reason function returns reason value.
|
|
func (e RemoteConfig_PolarisValidationError) Reason() string { return e.reason }
|
|
|
|
// Cause function returns cause value.
|
|
func (e RemoteConfig_PolarisValidationError) Cause() error { return e.cause }
|
|
|
|
// Key function returns key value.
|
|
func (e RemoteConfig_PolarisValidationError) Key() bool { return e.key }
|
|
|
|
// ErrorName returns error name.
|
|
func (e RemoteConfig_PolarisValidationError) ErrorName() string {
|
|
return "RemoteConfig_PolarisValidationError"
|
|
}
|
|
|
|
// Error satisfies the builtin error interface
|
|
func (e RemoteConfig_PolarisValidationError) 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 %sRemoteConfig_Polaris.%s: %s%s",
|
|
key,
|
|
e.field,
|
|
e.reason,
|
|
cause)
|
|
}
|
|
|
|
var _ error = RemoteConfig_PolarisValidationError{}
|
|
|
|
var _ interface {
|
|
Field() string
|
|
Reason() string
|
|
Key() bool
|
|
Cause() error
|
|
ErrorName() string
|
|
} = RemoteConfig_PolarisValidationError{}
|