Documentation
¶
Overview ¶
Package noahdesu/go-rados provides access to librados and librbd.
Index ¶
- func Version() (int, int, int)
- type ClusterStat
- type Conn
- func (c *Conn) Connect() error
- func (c *Conn) DeletePool(name string) error
- func (c *Conn) GetClusterStats() (stat ClusterStat, err error)
- func (c *Conn) GetConfigOption(name string) (value string, err error)
- func (c *Conn) GetFSID() (fsid string, err error)
- func (c *Conn) GetInstanceID() uint64
- func (c *Conn) ListPools() (names []string, err error)
- func (c *Conn) MakePool(name string) error
- func (c *Conn) OpenIOContext(pool string) (*IOContext, error)
- func (c *Conn) ParseCmdLineArgs(args []string) error
- func (c *Conn) ParseDefaultConfigEnv() error
- func (c *Conn) PingMonitor(id string) (string, error)
- func (c *Conn) ReadConfigFile(path string) error
- func (c *Conn) ReadDefaultConfigFile() error
- func (c *Conn) SetConfigOption(option, value string) error
- func (c *Conn) Shutdown()
- func (c *Conn) WaitForLatestOSDMap() error
- type IOContext
- func (ioctx *IOContext) Delete(oid string) error
- func (ioctx *IOContext) Destroy()
- func (ioctx *IOContext) GetPoolName() (name string, err error)
- func (ioctx *IOContext) GetPoolStats() (stat PoolStat, err error)
- func (ioctx *IOContext) ListObjects(listFn ObjectListFunc) error
- func (ioctx *IOContext) Read(oid string, data []byte, offset uint64) (int, error)
- func (ioctx *IOContext) Truncate(oid string, size uint64) error
- func (ioctx *IOContext) Write(oid string, data []byte, offset uint64) error
- type ObjectListFunc
- type PoolStat
- type RadosError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ClusterStat ¶
ClusterStat represents Ceph cluster statistics.
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection handle to a Ceph cluster.
func NewConn ¶
NewConn creates a new connection object. It returns the connection and an error, if any.
func (*Conn) Connect ¶
Connect establishes a connection to a RADOS cluster. It returns an error, if any.
func (*Conn) DeletePool ¶
DeletePool deletes a pool and all the data inside the pool.
func (*Conn) GetClusterStats ¶
func (c *Conn) GetClusterStats() (stat ClusterStat, err error)
GetClusterStat returns statistics about the cluster associated with the connection.
func (*Conn) GetConfigOption ¶
GetConfigOption returns the value of the Ceph configuration option identified by the given name.
func (*Conn) GetFSID ¶
GetFSID returns the fsid of the cluster as a hexadecimal string. The fsid is a unique identifier of an entire Ceph cluster.
func (*Conn) GetInstanceID ¶
GetInstanceID returns a globally unique identifier for the cluster connection instance.
func (*Conn) OpenIOContext ¶ added in v0.2.0
func (*Conn) ParseCmdLineArgs ¶
ParseCmdLineArgs configures the connection from command line arguments.
func (*Conn) ParseDefaultConfigEnv ¶
ParseDefaultConfigEnv configures the connection from the default Ceph environment variable(s).
func (*Conn) PingMonitor ¶
PingMonitor sends a ping to a monitor and returns the reply.
func (*Conn) ReadConfigFile ¶
ReadConfigFile configures the connection using a Ceph configuration file.
func (*Conn) ReadDefaultConfigFile ¶
ReadDefaultConfigFile configures the connection using a Ceph configuration file located at default locations.
func (*Conn) SetConfigOption ¶
SetConfigOption sets the value of the configuration option identified by the given name.
func (*Conn) WaitForLatestOSDMap ¶
WaitForLatestOSDMap blocks the caller until the latest OSD map has been retrieved.
type IOContext ¶ added in v0.2.0
type IOContext struct {
// contains filtered or unexported fields
}
IOContext represents a context for performing I/O within a pool.
func (*IOContext) Delete ¶ added in v0.2.0
Delete deletes the object with key oid. It returns an error, if any.
func (*IOContext) Destroy ¶ added in v0.2.0
func (ioctx *IOContext) Destroy()
Destroy informs librados that the I/O context is no longer in use. Resources associated with the context may not be freed immediately, and the context should not be used again after calling this method.
func (*IOContext) GetPoolName ¶ added in v0.2.0
GetPoolName returns the name of the pool associated with the I/O context.
func (*IOContext) GetPoolStats ¶ added in v0.2.0
Stat returns a set of statistics about the pool associated with this I/O context.
func (*IOContext) ListObjects ¶ added in v0.2.0
func (ioctx *IOContext) ListObjects(listFn ObjectListFunc) error
ListObjects lists all of the objects in the pool associated with the I/O context, and called the provided listFn function for each object, passing to the function the name of the object.
func (*IOContext) Read ¶ added in v0.2.0
Read reads up to len(data) bytes from the object with key oid starting at byte offset offset. It returns the number of bytes read and an error, if any.
type ObjectListFunc ¶ added in v0.2.0
type ObjectListFunc func(oid string)
ObjectListFunc is the type of the function called for each object visited by ListObjects.
type PoolStat ¶ added in v0.2.0
type PoolStat struct { // space used in bytes Num_bytes uint64 // space used in KB Num_kb uint64 // number of objects in the pool Num_objects uint64 // number of clones of objects Num_object_clones uint64 // num_objects * num_replicas Num_object_copies uint64 Num_objects_missing_on_primary uint64 // number of objects found on no OSDs Num_objects_unfound uint64 // number of objects replicated fewer times than they should be // (but found on at least one OSD) Num_objects_degraded uint64 Num_rd uint64 Num_rd_kb uint64 Num_wr uint64 Num_wr_kb uint64 }
PoolStat represents Ceph pool statistics.