// Code generated by protoc-gen-validate. DO NOT EDIT. // source: pkg/rpc/base/base.proto package base import ( "bytes" "errors" "fmt" "net" "net/mail" "net/url" "regexp" "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{} ) // Validate checks the field values on GrpcDfError with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned. func (m *GrpcDfError) Validate() error { if m == nil { return nil } // no validation rules for Code // no validation rules for Message return nil } // GrpcDfErrorValidationError is the validation error returned by // GrpcDfError.Validate if the designated constraints aren't met. type GrpcDfErrorValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e GrpcDfErrorValidationError) Field() string { return e.field } // Reason function returns reason value. func (e GrpcDfErrorValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e GrpcDfErrorValidationError) Cause() error { return e.cause } // Key function returns key value. func (e GrpcDfErrorValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e GrpcDfErrorValidationError) ErrorName() string { return "GrpcDfErrorValidationError" } // Error satisfies the builtin error interface func (e GrpcDfErrorValidationError) 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 %sGrpcDfError.%s: %s%s", key, e.field, e.reason, cause) } var _ error = GrpcDfErrorValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = GrpcDfErrorValidationError{} // Validate checks the field values on UrlMeta with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *UrlMeta) Validate() error { if m == nil { return nil } // no validation rules for Digest // no validation rules for Tag // no validation rules for Range // no validation rules for Filter // no validation rules for Header return nil } // UrlMetaValidationError is the validation error returned by UrlMeta.Validate // if the designated constraints aren't met. type UrlMetaValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e UrlMetaValidationError) Field() string { return e.field } // Reason function returns reason value. func (e UrlMetaValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e UrlMetaValidationError) Cause() error { return e.cause } // Key function returns key value. func (e UrlMetaValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e UrlMetaValidationError) ErrorName() string { return "UrlMetaValidationError" } // Error satisfies the builtin error interface func (e UrlMetaValidationError) 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 %sUrlMeta.%s: %s%s", key, e.field, e.reason, cause) } var _ error = UrlMetaValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = UrlMetaValidationError{} // Validate checks the field values on HostLoad with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *HostLoad) Validate() error { if m == nil { return nil } // no validation rules for CpuRatio // no validation rules for MemRatio // no validation rules for DiskRatio return nil } // HostLoadValidationError is the validation error returned by // HostLoad.Validate if the designated constraints aren't met. type HostLoadValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e HostLoadValidationError) Field() string { return e.field } // Reason function returns reason value. func (e HostLoadValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e HostLoadValidationError) Cause() error { return e.cause } // Key function returns key value. func (e HostLoadValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e HostLoadValidationError) ErrorName() string { return "HostLoadValidationError" } // Error satisfies the builtin error interface func (e HostLoadValidationError) 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 %sHostLoad.%s: %s%s", key, e.field, e.reason, cause) } var _ error = HostLoadValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = HostLoadValidationError{} // Validate checks the field values on PieceTaskRequest with the rules defined // in the proto definition for this message. If any rules are violated, an // error is returned. func (m *PieceTaskRequest) Validate() error { if m == nil { return nil } // no validation rules for TaskId // no validation rules for SrcPid // no validation rules for DstPid // no validation rules for StartNum // no validation rules for Limit return nil } // PieceTaskRequestValidationError is the validation error returned by // PieceTaskRequest.Validate if the designated constraints aren't met. type PieceTaskRequestValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PieceTaskRequestValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PieceTaskRequestValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PieceTaskRequestValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PieceTaskRequestValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PieceTaskRequestValidationError) ErrorName() string { return "PieceTaskRequestValidationError" } // Error satisfies the builtin error interface func (e PieceTaskRequestValidationError) 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 %sPieceTaskRequest.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PieceTaskRequestValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PieceTaskRequestValidationError{} // Validate checks the field values on PieceInfo with the rules defined in the // proto definition for this message. If any rules are violated, an error is returned. func (m *PieceInfo) Validate() error { if m == nil { return nil } // no validation rules for PieceNum // no validation rules for RangeStart // no validation rules for RangeSize // no validation rules for PieceMd5 // no validation rules for PieceOffset // no validation rules for PieceStyle return nil } // PieceInfoValidationError is the validation error returned by // PieceInfo.Validate if the designated constraints aren't met. type PieceInfoValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PieceInfoValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PieceInfoValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PieceInfoValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PieceInfoValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PieceInfoValidationError) ErrorName() string { return "PieceInfoValidationError" } // Error satisfies the builtin error interface func (e PieceInfoValidationError) 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 %sPieceInfo.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PieceInfoValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PieceInfoValidationError{} // Validate checks the field values on PiecePacket with the rules defined in // the proto definition for this message. If any rules are violated, an error // is returned. func (m *PiecePacket) Validate() error { if m == nil { return nil } // no validation rules for TaskId // no validation rules for DstPid // no validation rules for DstAddr for idx, item := range m.GetPieceInfos() { _, _ = idx, item if v, ok := interface{}(item).(interface{ Validate() error }); ok { if err := v.Validate(); err != nil { return PiecePacketValidationError{ field: fmt.Sprintf("PieceInfos[%v]", idx), reason: "embedded message failed validation", cause: err, } } } } // no validation rules for TotalPiece // no validation rules for ContentLength // no validation rules for PieceMd5Sign return nil } // PiecePacketValidationError is the validation error returned by // PiecePacket.Validate if the designated constraints aren't met. type PiecePacketValidationError struct { field string reason string cause error key bool } // Field function returns field value. func (e PiecePacketValidationError) Field() string { return e.field } // Reason function returns reason value. func (e PiecePacketValidationError) Reason() string { return e.reason } // Cause function returns cause value. func (e PiecePacketValidationError) Cause() error { return e.cause } // Key function returns key value. func (e PiecePacketValidationError) Key() bool { return e.key } // ErrorName returns error name. func (e PiecePacketValidationError) ErrorName() string { return "PiecePacketValidationError" } // Error satisfies the builtin error interface func (e PiecePacketValidationError) 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 %sPiecePacket.%s: %s%s", key, e.field, e.reason, cause) } var _ error = PiecePacketValidationError{} var _ interface { Field() string Reason() string Key() bool Cause() error ErrorName() string } = PiecePacketValidationError{}