rebase: update go-ceph version to v0.11.0

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
Humble Chirammal
2021-08-12 15:32:52 +05:30
committed by mergify[bot]
parent 87beaac25b
commit 56ac143450
20 changed files with 881 additions and 406 deletions

View File

@ -55,9 +55,9 @@ const (
// Version returns the major, minor, and patch components of the version of
// the RADOS library linked against.
func Version() (int, int, int) {
var c_major, c_minor, c_patch C.int
C.rados_version(&c_major, &c_minor, &c_patch)
return int(c_major), int(c_minor), int(c_patch)
var cMajor, cMinor, cPatch C.int
C.rados_version(&cMajor, &cMinor, &cPatch)
return int(cMajor), int(cMinor), int(cPatch)
}
func makeConn() *Conn {
@ -85,22 +85,22 @@ func NewConn() (*Conn, error) {
// NewConnWithUser creates a new connection object with a custom username.
// It returns the connection and an error, if any.
func NewConnWithUser(user string) (*Conn, error) {
c_user := C.CString(user)
defer C.free(unsafe.Pointer(c_user))
return newConn(c_user)
cUser := C.CString(user)
defer C.free(unsafe.Pointer(cUser))
return newConn(cUser)
}
// NewConnWithClusterAndUser creates a new connection object for a specific cluster and username.
// It returns the connection and an error, if any.
func NewConnWithClusterAndUser(clusterName string, userName string) (*Conn, error) {
c_cluster_name := C.CString(clusterName)
defer C.free(unsafe.Pointer(c_cluster_name))
cClusterName := C.CString(clusterName)
defer C.free(unsafe.Pointer(cClusterName))
c_name := C.CString(userName)
defer C.free(unsafe.Pointer(c_name))
cName := C.CString(userName)
defer C.free(unsafe.Pointer(cName))
conn := makeConn()
ret := C.rados_create2(&conn.cluster, c_cluster_name, c_name, 0)
ret := C.rados_create2(&conn.cluster, cClusterName, cName, 0)
if ret != 0 {
return nil, getError(ret)
}