cephd

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RbdErrorImageNotOpen = errors.New("RBD image not open")
View Source
var RbdErrorNotFound = errors.New("RBD image not found")

Functions

func GetCephdError

func GetCephdError(err int) error

func New

func New() *ceph

func RadosVersion

func RadosVersion() (int, int, int)

Version returns the major, minor, and patch components of the version of the RADOS library linked against.

func Version

func Version() string

Version returns the version of Ceph

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) GetImage

func (ioctx *IOContext) GetImage(name string) client.Image

func (*IOContext) GetImageNames

func (ioctx *IOContext) GetImageNames() (names []string, err error)

GetImageNames returns the list of current RBD images.

func (*IOContext) Pointer

func (ioctx *IOContext) Pointer() uintptr

Pointer returns a uintptr representation of the IOContext.

func (*IOContext) Read

func (ioctx *IOContext) Read(oid string, data []byte, offset uint64) (int, error)

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.

func (*IOContext) Write

func (ioctx *IOContext) Write(oid string, data []byte, offset uint64) error

Write writes len(data) bytes to the object with key oid starting at byte offset offset. It returns an error, if any.

func (*IOContext) WriteFull

func (ioctx *IOContext) WriteFull(oid string, data []byte) error

WriteFull writes len(data) bytes to the object with key oid. The object is filled with the provided data. If the object exists, it is atomically truncated and then written. It returns 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) Close

func (image *Image) Close() error

int rbd_close(rbd_image_t image);

func (*Image) Name

func (i *Image) Name() string

func (*Image) Open

func (image *Image) Open(args ...interface{}) error

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);

func (*Image) Stat

func (image *Image) Stat() (info *client.ImageInfo, err error)

int rbd_stat(rbd_image_t image, rbd_image_info_t *info, size_t infosize);

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL