rebase: update go-ceph to v0.5.0

as go-ceph is 0.5.0 is released updating
the dependency to latest release.
more info about release at
https://github.com/ceph/go-ceph/releases/tag/v0.5.0

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna
2020-08-11 20:12:21 +05:30
committed by mergify[bot]
parent 5f6fec5f0a
commit 2808d526bb
26 changed files with 816 additions and 199 deletions

View File

@ -7,24 +7,19 @@ import "C"
import (
"errors"
"fmt"
"github.com/ceph/go-ceph/internal/errutil"
)
// revive:disable:exported Temporarily live with stuttering
// rbdError represents an error condition returned from the librbd APIs.
type rbdError int
// RBDError represents an error condition returned from the librbd APIs.
type RBDError int
func (e rbdError) Error() string {
return errutil.FormatErrorCode("rbd", int(e))
}
// revive:enable:exported
func (e RBDError) Error() string {
errno, s := errutil.FormatErrno(int(e))
if s == "" {
return fmt.Sprintf("rbd: ret=%d", errno)
}
return fmt.Sprintf("rbd: ret=%d, %s", errno, s)
func (e rbdError) ErrorCode() int {
return int(e)
}
func getError(err C.int) error {
@ -32,7 +27,7 @@ func getError(err C.int) error {
if err == -C.ENOENT {
return ErrNotFound
}
return RBDError(err)
return rbdError(err)
}
return nil
}
@ -79,5 +74,5 @@ var (
// Private errors:
const (
errRange = RBDError(-C.ERANGE)
errRange = rbdError(-C.ERANGE)
)