rados: support fetching the cluster from the Conn

The cephfs function ceph_create_from_rados requires the cluster_t
value, which is current private to the Conn type. Alias the cluster_t
type and allow other pkgs to get it if needed.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
John Mulligan 2019-12-18 17:25:37 -05:00 committed by Niels de Vos
parent 7ccc2a2d9b
commit 46ed646e03
1 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,14 @@ type Conn struct {
connected bool
}
// ClusterRef represents a fundamental RADOS cluster connection.
type ClusterRef C.rados_t
// Cluster returns the underlying RADOS cluster reference for this Conn.
func (c *Conn) Cluster() ClusterRef {
return ClusterRef(c.cluster)
}
// PingMonitor sends a ping to a monitor and returns the reply.
func (c *Conn) PingMonitor(id string) (string, error) {
c_id := C.CString(id)