Documentation ¶
Index ¶
- Variables
- func GetCephdError(err int) error
- func New() *ceph
- func RadosVersion() (int, int, int)
- func RunCommand(command string, args []string) error
- func Version() string
- type IOContext
- func (ioctx *IOContext) CreateImage(name string, size uint64, order int, args ...uint64) (image client.Image, err error)
- func (ioctx *IOContext) Destroy()
- func (ioctx *IOContext) GetImage(name string) client.Image
- func (ioctx *IOContext) GetImageNames() (names []string, err error)
- func (ioctx *IOContext) Pointer() uintptr
- func (ioctx *IOContext) Read(oid string, data []byte, offset uint64) (int, error)
- func (ioctx *IOContext) Write(oid string, data []byte, offset uint64) error
- func (ioctx *IOContext) WriteFull(oid string, data []byte) error
- type Image
Constants ¶
This section is empty.
Variables ¶
var RbdErrorImageNotOpen = errors.New("RBD image not open")
var RbdErrorNotFound = errors.New("RBD image not found")
Functions ¶
func GetCephdError ¶
func RadosVersion ¶
Version returns the major, minor, and patch components of the version of the RADOS library linked against.
func RunCommand ¶ added in v0.3.0
run a command in libcephd
Types ¶
type IOContext ¶
type IOContext struct {
// contains filtered or unexported fields
}
IOContext represents a context for performing I/O within a pool.
func (*IOContext) CreateImage ¶
func (ioctx *IOContext) CreateImage(name string, size uint64, order int, args ...uint64) (image client.Image, err error)
int rbd_create(rados_ioctx_t io, const char *name, uint64_t size, int *order); int rbd_create2(rados_ioctx_t io, const char *name, uint64_t size,
uint64_t features, int *order);
int rbd_create3(rados_ioctx_t io, const char *name, uint64_t size,
uint64_t features, int *order, uint64_t stripe_unit, uint64_t stripe_count);
func (*IOContext) Destroy ¶ added in v0.3.1
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) GetImageNames ¶
GetImageNames returns the list of current RBD images.
func (*IOContext) Read ¶
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 Image ¶
type Image struct { io.Reader io.Writer io.Seeker io.ReaderAt io.WriterAt // contains filtered or unexported fields }
**************** librbd ***************************
func (*Image) Open ¶
int rbd_open(rados_ioctx_t io, const char *name, rbd_image_t *image, const char *snap_name); int rbd_open_read_only(rados_ioctx_t io, const char *name, rbd_image_t *image,
const char *snap_name);