mirror of https://github.com/dragonflyoss/api.git
feat: change download piece failed message (#210)
Signed-off-by: Gaius <gaius.qi@gmail.com>
This commit is contained in:
parent
6261753124
commit
b53f8ac93c
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "dragonfly-api"
|
name = "dragonfly-api"
|
||||||
version = "2.0.46"
|
version = "2.0.48"
|
||||||
authors = ["Gaius <gaius.qi@gmail.com>"]
|
authors = ["Gaius <gaius.qi@gmail.com>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1460,10 +1460,10 @@ func (m *DownloadPieceFailedRequest) validate(all bool) error {
|
||||||
|
|
||||||
var errors []error
|
var errors []error
|
||||||
|
|
||||||
if m.GetPiece() == nil {
|
if m.GetPieceNumber() < 0 {
|
||||||
err := DownloadPieceFailedRequestValidationError{
|
err := DownloadPieceFailedRequestValidationError{
|
||||||
field: "Piece",
|
field: "PieceNumber",
|
||||||
reason: "value is required",
|
reason: "value must be greater than or equal to 0",
|
||||||
}
|
}
|
||||||
if !all {
|
if !all {
|
||||||
return err
|
return err
|
||||||
|
@ -1471,33 +1471,15 @@ func (m *DownloadPieceFailedRequest) validate(all bool) error {
|
||||||
errors = append(errors, err)
|
errors = append(errors, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if all {
|
if utf8.RuneCountInString(m.GetParentId()) < 1 {
|
||||||
switch v := interface{}(m.GetPiece()).(type) {
|
err := DownloadPieceFailedRequestValidationError{
|
||||||
case interface{ ValidateAll() error }:
|
field: "ParentId",
|
||||||
if err := v.ValidateAll(); err != nil {
|
reason: "value length must be at least 1 runes",
|
||||||
errors = append(errors, DownloadPieceFailedRequestValidationError{
|
|
||||||
field: "Piece",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceFailedRequestValidationError{
|
|
||||||
field: "Piece",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if v, ok := interface{}(m.GetPiece()).(interface{ Validate() error }); ok {
|
if !all {
|
||||||
if err := v.Validate(); err != nil {
|
return err
|
||||||
return DownloadPieceFailedRequestValidationError{
|
|
||||||
field: "Piece",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
errors = append(errors, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// no validation rules for Temporary
|
// no validation rules for Temporary
|
||||||
|
@ -1705,303 +1687,6 @@ var _ interface {
|
||||||
ErrorName() string
|
ErrorName() string
|
||||||
} = HTTPResponseValidationError{}
|
} = HTTPResponseValidationError{}
|
||||||
|
|
||||||
// Validate checks the field values on HDFSResponse 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 *HDFSResponse) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on HDFSResponse 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 HDFSResponseMultiError, or
|
|
||||||
// nil if none found.
|
|
||||||
func (m *HDFSResponse) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *HDFSResponse) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return HDFSResponseMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// HDFSResponseMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by HDFSResponse.ValidateAll() if the designated constraints aren't met.
|
|
||||||
type HDFSResponseMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m HDFSResponseMultiError) 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 HDFSResponseMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// HDFSResponseValidationError is the validation error returned by
|
|
||||||
// HDFSResponse.Validate if the designated constraints aren't met.
|
|
||||||
type HDFSResponseValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e HDFSResponseValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e HDFSResponseValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e HDFSResponseValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e HDFSResponseValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e HDFSResponseValidationError) ErrorName() string { return "HDFSResponseValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e HDFSResponseValidationError) 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 %sHDFSResponse.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = HDFSResponseValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = HDFSResponseValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on S3Response 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 *S3Response) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on S3Response 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 S3ResponseMultiError, or
|
|
||||||
// nil if none found.
|
|
||||||
func (m *S3Response) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *S3Response) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return S3ResponseMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// S3ResponseMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by S3Response.ValidateAll() if the designated constraints aren't met.
|
|
||||||
type S3ResponseMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m S3ResponseMultiError) 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 S3ResponseMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// S3ResponseValidationError is the validation error returned by
|
|
||||||
// S3Response.Validate if the designated constraints aren't met.
|
|
||||||
type S3ResponseValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e S3ResponseValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e S3ResponseValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e S3ResponseValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e S3ResponseValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e S3ResponseValidationError) ErrorName() string { return "S3ResponseValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e S3ResponseValidationError) 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 %sS3Response.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = S3ResponseValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = S3ResponseValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on OSSResponse 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 *OSSResponse) Validate() error {
|
|
||||||
return m.validate(false)
|
|
||||||
}
|
|
||||||
|
|
||||||
// ValidateAll checks the field values on OSSResponse 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 OSSResponseMultiError, or
|
|
||||||
// nil if none found.
|
|
||||||
func (m *OSSResponse) ValidateAll() error {
|
|
||||||
return m.validate(true)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *OSSResponse) validate(all bool) error {
|
|
||||||
if m == nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
var errors []error
|
|
||||||
|
|
||||||
if len(errors) > 0 {
|
|
||||||
return OSSResponseMultiError(errors)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
// OSSResponseMultiError is an error wrapping multiple validation errors
|
|
||||||
// returned by OSSResponse.ValidateAll() if the designated constraints aren't met.
|
|
||||||
type OSSResponseMultiError []error
|
|
||||||
|
|
||||||
// Error returns a concatenation of all the error messages it wraps.
|
|
||||||
func (m OSSResponseMultiError) 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 OSSResponseMultiError) AllErrors() []error { return m }
|
|
||||||
|
|
||||||
// OSSResponseValidationError is the validation error returned by
|
|
||||||
// OSSResponse.Validate if the designated constraints aren't met.
|
|
||||||
type OSSResponseValidationError struct {
|
|
||||||
field string
|
|
||||||
reason string
|
|
||||||
cause error
|
|
||||||
key bool
|
|
||||||
}
|
|
||||||
|
|
||||||
// Field function returns field value.
|
|
||||||
func (e OSSResponseValidationError) Field() string { return e.field }
|
|
||||||
|
|
||||||
// Reason function returns reason value.
|
|
||||||
func (e OSSResponseValidationError) Reason() string { return e.reason }
|
|
||||||
|
|
||||||
// Cause function returns cause value.
|
|
||||||
func (e OSSResponseValidationError) Cause() error { return e.cause }
|
|
||||||
|
|
||||||
// Key function returns key value.
|
|
||||||
func (e OSSResponseValidationError) Key() bool { return e.key }
|
|
||||||
|
|
||||||
// ErrorName returns error name.
|
|
||||||
func (e OSSResponseValidationError) ErrorName() string { return "OSSResponseValidationError" }
|
|
||||||
|
|
||||||
// Error satisfies the builtin error interface
|
|
||||||
func (e OSSResponseValidationError) 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 %sOSSResponse.%s: %s%s",
|
|
||||||
key,
|
|
||||||
e.field,
|
|
||||||
e.reason,
|
|
||||||
cause)
|
|
||||||
}
|
|
||||||
|
|
||||||
var _ error = OSSResponseValidationError{}
|
|
||||||
|
|
||||||
var _ interface {
|
|
||||||
Field() string
|
|
||||||
Reason() string
|
|
||||||
Key() bool
|
|
||||||
Cause() error
|
|
||||||
ErrorName() string
|
|
||||||
} = OSSResponseValidationError{}
|
|
||||||
|
|
||||||
// Validate checks the field values on DownloadPieceBackToSourceFailedRequest
|
// Validate checks the field values on DownloadPieceBackToSourceFailedRequest
|
||||||
// with the rules defined in the proto definition for this message. If any
|
// 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
|
// rules are violated, the first error encountered is returned, or nil if
|
||||||
|
@ -2026,10 +1711,10 @@ func (m *DownloadPieceBackToSourceFailedRequest) validate(all bool) error {
|
||||||
|
|
||||||
var errors []error
|
var errors []error
|
||||||
|
|
||||||
if m.GetPiece() == nil {
|
if m.GetPieceNumber() < 0 {
|
||||||
err := DownloadPieceBackToSourceFailedRequestValidationError{
|
err := DownloadPieceBackToSourceFailedRequestValidationError{
|
||||||
field: "Piece",
|
field: "PieceNumber",
|
||||||
reason: "value is required",
|
reason: "value must be greater than or equal to 0",
|
||||||
}
|
}
|
||||||
if !all {
|
if !all {
|
||||||
return err
|
return err
|
||||||
|
@ -2037,35 +1722,6 @@ func (m *DownloadPieceBackToSourceFailedRequest) validate(all bool) error {
|
||||||
errors = append(errors, err)
|
errors = append(errors, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetPiece()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "Piece",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "Piece",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetPiece()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "Piece",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
oneofResponsePresent := false
|
oneofResponsePresent := false
|
||||||
switch v := m.Response.(type) {
|
switch v := m.Response.(type) {
|
||||||
case *DownloadPieceBackToSourceFailedRequest_HttpResponse:
|
case *DownloadPieceBackToSourceFailedRequest_HttpResponse:
|
||||||
|
@ -2110,132 +1766,6 @@ func (m *DownloadPieceBackToSourceFailedRequest) validate(all bool) error {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case *DownloadPieceBackToSourceFailedRequest_HdfsResponse:
|
|
||||||
if v == nil {
|
|
||||||
err := DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "Response",
|
|
||||||
reason: "oneof value cannot be a typed-nil",
|
|
||||||
}
|
|
||||||
if !all {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
errors = append(errors, err)
|
|
||||||
}
|
|
||||||
oneofResponsePresent = true
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetHdfsResponse()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "HdfsResponse",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "HdfsResponse",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetHdfsResponse()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "HdfsResponse",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case *DownloadPieceBackToSourceFailedRequest_S3Response:
|
|
||||||
if v == nil {
|
|
||||||
err := DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "Response",
|
|
||||||
reason: "oneof value cannot be a typed-nil",
|
|
||||||
}
|
|
||||||
if !all {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
errors = append(errors, err)
|
|
||||||
}
|
|
||||||
oneofResponsePresent = true
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetS3Response()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "S3Response",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "S3Response",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetS3Response()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "S3Response",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
case *DownloadPieceBackToSourceFailedRequest_OssResponse:
|
|
||||||
if v == nil {
|
|
||||||
err := DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "Response",
|
|
||||||
reason: "oneof value cannot be a typed-nil",
|
|
||||||
}
|
|
||||||
if !all {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
errors = append(errors, err)
|
|
||||||
}
|
|
||||||
oneofResponsePresent = true
|
|
||||||
|
|
||||||
if all {
|
|
||||||
switch v := interface{}(m.GetOssResponse()).(type) {
|
|
||||||
case interface{ ValidateAll() error }:
|
|
||||||
if err := v.ValidateAll(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "OssResponse",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
case interface{ Validate() error }:
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
errors = append(errors, DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "OssResponse",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if v, ok := interface{}(m.GetOssResponse()).(interface{ Validate() error }); ok {
|
|
||||||
if err := v.Validate(); err != nil {
|
|
||||||
return DownloadPieceBackToSourceFailedRequestValidationError{
|
|
||||||
field: "OssResponse",
|
|
||||||
reason: "embedded message failed validation",
|
|
||||||
cause: err,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
_ = v // ensures v is used
|
_ = v // ensures v is used
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,10 +96,12 @@ message DownloadPieceBackToSourceFinishedRequest {
|
||||||
|
|
||||||
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
|
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
|
||||||
message DownloadPieceFailedRequest {
|
message DownloadPieceFailedRequest {
|
||||||
// Piece info.
|
// Piece number.
|
||||||
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
|
int32 piece_number = 1 [(validate.rules).int32.gte = 0];
|
||||||
|
// Parent id.
|
||||||
|
string parent_id = 2 [(validate.rules).string.min_len = 1];
|
||||||
// Temporary indicates whether the error is temporary.
|
// Temporary indicates whether the error is temporary.
|
||||||
bool temporary = 2;
|
bool temporary = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTPResponse represents http protocol response of DownloadPieceBackToSourceFailedRequest.
|
// HTTPResponse represents http protocol response of DownloadPieceBackToSourceFailedRequest.
|
||||||
|
@ -112,30 +114,15 @@ message HTTPResponse {
|
||||||
string status = 3 [(validate.rules).string.min_len = 1];
|
string status = 3 [(validate.rules).string.min_len = 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// HDFSResponse represents hdfs protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
message HDFSResponse {
|
|
||||||
}
|
|
||||||
|
|
||||||
// S3Response represents s3 protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
message S3Response {
|
|
||||||
}
|
|
||||||
|
|
||||||
// OSSResponse represents oss protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
message OSSResponse {
|
|
||||||
}
|
|
||||||
|
|
||||||
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
||||||
message DownloadPieceBackToSourceFailedRequest {
|
message DownloadPieceBackToSourceFailedRequest {
|
||||||
// Piece info.
|
// Piece number.
|
||||||
common.v2.Piece piece = 1 [(validate.rules).message.required = true];
|
int32 piece_number = 1 [(validate.rules).int32.gte = 0];
|
||||||
|
|
||||||
oneof response {
|
oneof response {
|
||||||
option (validate.required) = true;
|
option (validate.required) = true;
|
||||||
|
|
||||||
HTTPResponse http_response = 2;
|
HTTPResponse http_response = 2;
|
||||||
HDFSResponse hdfs_response = 3;
|
|
||||||
S3Response s3_response = 4;
|
|
||||||
OSSResponse oss_response = 5;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -93,10 +93,12 @@ message DownloadPieceBackToSourceFinishedRequest {
|
||||||
|
|
||||||
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
|
// DownloadPieceFailedRequest downloads piece failed request of AnnouncePeerRequest.
|
||||||
message DownloadPieceFailedRequest {
|
message DownloadPieceFailedRequest {
|
||||||
// Piece info.
|
// Piece number.
|
||||||
common.v2.Piece piece = 1;
|
int32 piece_number = 1;
|
||||||
|
// Parent id.
|
||||||
|
string parent_id = 2;
|
||||||
// Temporary indicates whether the error is temporary.
|
// Temporary indicates whether the error is temporary.
|
||||||
bool temporary = 2;
|
bool temporary = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HTTPResponse represents http protocol response of DownloadPieceBackToSourceFailedRequest.
|
// HTTPResponse represents http protocol response of DownloadPieceBackToSourceFailedRequest.
|
||||||
|
@ -109,28 +111,13 @@ message HTTPResponse {
|
||||||
string status = 3;
|
string status = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// HDFSResponse represents hdfs protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
message HDFSResponse {
|
|
||||||
}
|
|
||||||
|
|
||||||
// S3Response represents s3 protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
message S3Response {
|
|
||||||
}
|
|
||||||
|
|
||||||
// OSSResponse represents oss protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
message OSSResponse {
|
|
||||||
}
|
|
||||||
|
|
||||||
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
||||||
message DownloadPieceBackToSourceFailedRequest {
|
message DownloadPieceBackToSourceFailedRequest {
|
||||||
// Piece info.
|
// Piece number.
|
||||||
common.v2.Piece piece = 1;
|
int32 piece_number = 1;
|
||||||
|
|
||||||
oneof response {
|
oneof response {
|
||||||
HTTPResponse http_response = 2;
|
HTTPResponse http_response = 2;
|
||||||
HDFSResponse hdfs_response = 3;
|
|
||||||
S3Response s3_response = 4;
|
|
||||||
OSSResponse oss_response = 5;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
|
@ -104,11 +104,14 @@ pub struct DownloadPieceBackToSourceFinishedRequest {
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct DownloadPieceFailedRequest {
|
pub struct DownloadPieceFailedRequest {
|
||||||
/// Piece info.
|
/// Piece number.
|
||||||
#[prost(message, optional, tag = "1")]
|
#[prost(int32, tag = "1")]
|
||||||
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
|
pub piece_number: i32,
|
||||||
|
/// Parent id.
|
||||||
|
#[prost(string, tag = "2")]
|
||||||
|
pub parent_id: ::prost::alloc::string::String,
|
||||||
/// Temporary indicates whether the error is temporary.
|
/// Temporary indicates whether the error is temporary.
|
||||||
#[prost(bool, tag = "2")]
|
#[prost(bool, tag = "3")]
|
||||||
pub temporary: bool,
|
pub temporary: bool,
|
||||||
}
|
}
|
||||||
/// HTTPResponse represents http protocol response of DownloadPieceBackToSourceFailedRequest.
|
/// HTTPResponse represents http protocol response of DownloadPieceBackToSourceFailedRequest.
|
||||||
|
@ -129,32 +132,17 @@ pub struct HttpResponse {
|
||||||
#[prost(string, tag = "3")]
|
#[prost(string, tag = "3")]
|
||||||
pub status: ::prost::alloc::string::String,
|
pub status: ::prost::alloc::string::String,
|
||||||
}
|
}
|
||||||
/// HDFSResponse represents hdfs protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct HdfsResponse {}
|
|
||||||
/// S3Response represents s3 protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct S3Response {}
|
|
||||||
/// OSSResponse represents oss protocol response of DownloadPieceBackToSourceFailedRequest.
|
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
|
||||||
pub struct OssResponse {}
|
|
||||||
/// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
/// DownloadPieceBackToSourceFailedRequest downloads piece back-to-source failed request of AnnouncePeerRequest.
|
||||||
#[derive(serde::Serialize, serde::Deserialize)]
|
#[derive(serde::Serialize, serde::Deserialize)]
|
||||||
#[allow(clippy::derive_partial_eq_without_eq)]
|
#[allow(clippy::derive_partial_eq_without_eq)]
|
||||||
#[derive(Clone, PartialEq, ::prost::Message)]
|
#[derive(Clone, PartialEq, ::prost::Message)]
|
||||||
pub struct DownloadPieceBackToSourceFailedRequest {
|
pub struct DownloadPieceBackToSourceFailedRequest {
|
||||||
/// Piece info.
|
/// Piece number.
|
||||||
#[prost(message, optional, tag = "1")]
|
#[prost(int32, tag = "1")]
|
||||||
pub piece: ::core::option::Option<super::super::common::v2::Piece>,
|
pub piece_number: i32,
|
||||||
#[prost(
|
#[prost(
|
||||||
oneof = "download_piece_back_to_source_failed_request::Response",
|
oneof = "download_piece_back_to_source_failed_request::Response",
|
||||||
tags = "2, 3, 4, 5"
|
tags = "2"
|
||||||
)]
|
)]
|
||||||
pub response: ::core::option::Option<
|
pub response: ::core::option::Option<
|
||||||
download_piece_back_to_source_failed_request::Response,
|
download_piece_back_to_source_failed_request::Response,
|
||||||
|
@ -168,12 +156,6 @@ pub mod download_piece_back_to_source_failed_request {
|
||||||
pub enum Response {
|
pub enum Response {
|
||||||
#[prost(message, tag = "2")]
|
#[prost(message, tag = "2")]
|
||||||
HttpResponse(super::HttpResponse),
|
HttpResponse(super::HttpResponse),
|
||||||
#[prost(message, tag = "3")]
|
|
||||||
HdfsResponse(super::HdfsResponse),
|
|
||||||
#[prost(message, tag = "4")]
|
|
||||||
S3Response(super::S3Response),
|
|
||||||
#[prost(message, tag = "5")]
|
|
||||||
OssResponse(super::OssResponse),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// SyncPiecesFailedRequest syncs pieces failed request of AnnouncePeerRequest.
|
/// SyncPiecesFailedRequest syncs pieces failed request of AnnouncePeerRequest.
|
||||||
|
|
Loading…
Reference in New Issue