gitee.com/ks-custle/core-gm@v0.0.0-20230922171213-b83bdd97b62c/go-control-plane/envoy/extensions/health_checkers/redis/v3/redis.pb.validate.go (about)

     1  // Code generated by protoc-gen-validate. DO NOT EDIT.
     2  // source: envoy/extensions/health_checkers/redis/v3/redis.proto
     3  
     4  package envoy_extensions_health_checkers_redis_v3
     5  
     6  import (
     7  	"bytes"
     8  	"errors"
     9  	"fmt"
    10  	"net"
    11  	"net/mail"
    12  	"net/url"
    13  	"regexp"
    14  	"strings"
    15  	"time"
    16  	"unicode/utf8"
    17  
    18  	"google.golang.org/protobuf/types/known/anypb"
    19  )
    20  
    21  // ensure the imports are used
    22  var (
    23  	_ = bytes.MinRead
    24  	_ = errors.New("")
    25  	_ = fmt.Print
    26  	_ = utf8.UTFMax
    27  	_ = (*regexp.Regexp)(nil)
    28  	_ = (*strings.Reader)(nil)
    29  	_ = net.IPv4len
    30  	_ = time.Duration(0)
    31  	_ = (*url.URL)(nil)
    32  	_ = (*mail.Address)(nil)
    33  	_ = anypb.Any{}
    34  )
    35  
    36  // Validate checks the field values on Redis with the rules defined in the
    37  // proto definition for this message. If any rules are violated, an error is returned.
    38  func (m *Redis) Validate() error {
    39  	if m == nil {
    40  		return nil
    41  	}
    42  
    43  	// no validation rules for Key
    44  
    45  	return nil
    46  }
    47  
    48  // RedisValidationError is the validation error returned by Redis.Validate if
    49  // the designated constraints aren't met.
    50  type RedisValidationError struct {
    51  	field  string
    52  	reason string
    53  	cause  error
    54  	key    bool
    55  }
    56  
    57  // Field function returns field value.
    58  func (e RedisValidationError) Field() string { return e.field }
    59  
    60  // Reason function returns reason value.
    61  func (e RedisValidationError) Reason() string { return e.reason }
    62  
    63  // Cause function returns cause value.
    64  func (e RedisValidationError) Cause() error { return e.cause }
    65  
    66  // Key function returns key value.
    67  func (e RedisValidationError) Key() bool { return e.key }
    68  
    69  // ErrorName returns error name.
    70  func (e RedisValidationError) ErrorName() string { return "RedisValidationError" }
    71  
    72  // Error satisfies the builtin error interface
    73  func (e RedisValidationError) Error() string {
    74  	cause := ""
    75  	if e.cause != nil {
    76  		cause = fmt.Sprintf(" | caused by: %v", e.cause)
    77  	}
    78  
    79  	key := ""
    80  	if e.key {
    81  		key = "key for "
    82  	}
    83  
    84  	return fmt.Sprintf(
    85  		"invalid %sRedis.%s: %s%s",
    86  		key,
    87  		e.field,
    88  		e.reason,
    89  		cause)
    90  }
    91  
    92  var _ error = RedisValidationError{}
    93  
    94  var _ interface {
    95  	Field() string
    96  	Reason() string
    97  	Key() bool
    98  	Cause() error
    99  	ErrorName() string
   100  } = RedisValidationError{}