/pkg/api/envoy/service/tap/v4alpha/tap.pb.validate.go
https://github.com/datawire/ambassador · Go · 280 lines · 190 code · 50 blank · 40 comment · 26 complexity · e5792b62e7f49cb12b05ba60109560a3 MD5 · raw file
- // Code generated by protoc-gen-validate. DO NOT EDIT.
- // source: envoy/service/tap/v4alpha/tap.proto
- package envoy_service_tap_v4alpha
- import (
- "bytes"
- "errors"
- "fmt"
- "net"
- "net/mail"
- "net/url"
- "regexp"
- "strings"
- "time"
- "unicode/utf8"
- "github.com/golang/protobuf/ptypes"
- )
- // 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)
- _ = ptypes.DynamicAny{}
- )
- // define the regex for a UUID once up-front
- var _tap_uuidPattern = regexp.MustCompile("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$")
- // Validate checks the field values on StreamTapsRequest with the rules defined
- // in the proto definition for this message. If any rules are violated, an
- // error is returned.
- func (m *StreamTapsRequest) Validate() error {
- if m == nil {
- return nil
- }
- if v, ok := interface{}(m.GetIdentifier()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return StreamTapsRequestValidationError{
- field: "Identifier",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for TraceId
- if v, ok := interface{}(m.GetTrace()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return StreamTapsRequestValidationError{
- field: "Trace",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- return nil
- }
- // StreamTapsRequestValidationError is the validation error returned by
- // StreamTapsRequest.Validate if the designated constraints aren't met.
- type StreamTapsRequestValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e StreamTapsRequestValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e StreamTapsRequestValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e StreamTapsRequestValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e StreamTapsRequestValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e StreamTapsRequestValidationError) ErrorName() string {
- return "StreamTapsRequestValidationError"
- }
- // Error satisfies the builtin error interface
- func (e StreamTapsRequestValidationError) 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 %sStreamTapsRequest.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = StreamTapsRequestValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = StreamTapsRequestValidationError{}
- // Validate checks the field values on StreamTapsResponse with the rules
- // defined in the proto definition for this message. If any rules are
- // violated, an error is returned.
- func (m *StreamTapsResponse) Validate() error {
- if m == nil {
- return nil
- }
- return nil
- }
- // StreamTapsResponseValidationError is the validation error returned by
- // StreamTapsResponse.Validate if the designated constraints aren't met.
- type StreamTapsResponseValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e StreamTapsResponseValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e StreamTapsResponseValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e StreamTapsResponseValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e StreamTapsResponseValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e StreamTapsResponseValidationError) ErrorName() string {
- return "StreamTapsResponseValidationError"
- }
- // Error satisfies the builtin error interface
- func (e StreamTapsResponseValidationError) 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 %sStreamTapsResponse.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = StreamTapsResponseValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = StreamTapsResponseValidationError{}
- // Validate checks the field values on StreamTapsRequest_Identifier with the
- // rules defined in the proto definition for this message. If any rules are
- // violated, an error is returned.
- func (m *StreamTapsRequest_Identifier) Validate() error {
- if m == nil {
- return nil
- }
- if m.GetNode() == nil {
- return StreamTapsRequest_IdentifierValidationError{
- field: "Node",
- reason: "value is required",
- }
- }
- if v, ok := interface{}(m.GetNode()).(interface{ Validate() error }); ok {
- if err := v.Validate(); err != nil {
- return StreamTapsRequest_IdentifierValidationError{
- field: "Node",
- reason: "embedded message failed validation",
- cause: err,
- }
- }
- }
- // no validation rules for TapId
- return nil
- }
- // StreamTapsRequest_IdentifierValidationError is the validation error returned
- // by StreamTapsRequest_Identifier.Validate if the designated constraints
- // aren't met.
- type StreamTapsRequest_IdentifierValidationError struct {
- field string
- reason string
- cause error
- key bool
- }
- // Field function returns field value.
- func (e StreamTapsRequest_IdentifierValidationError) Field() string { return e.field }
- // Reason function returns reason value.
- func (e StreamTapsRequest_IdentifierValidationError) Reason() string { return e.reason }
- // Cause function returns cause value.
- func (e StreamTapsRequest_IdentifierValidationError) Cause() error { return e.cause }
- // Key function returns key value.
- func (e StreamTapsRequest_IdentifierValidationError) Key() bool { return e.key }
- // ErrorName returns error name.
- func (e StreamTapsRequest_IdentifierValidationError) ErrorName() string {
- return "StreamTapsRequest_IdentifierValidationError"
- }
- // Error satisfies the builtin error interface
- func (e StreamTapsRequest_IdentifierValidationError) 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 %sStreamTapsRequest_Identifier.%s: %s%s",
- key,
- e.field,
- e.reason,
- cause)
- }
- var _ error = StreamTapsRequest_IdentifierValidationError{}
- var _ interface {
- Field() string
- Reason() string
- Key() bool
- Cause() error
- ErrorName() string
- } = StreamTapsRequest_IdentifierValidationError{}