예제 #1
0
// Remove deletes the named object in the pool referenced by the given context.
func (c *Context) Remove(name string) error {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	if cerr := C.rados_remove(c.ctx, cname); cerr != 0 {
		return fmt.Errorf("RADOS remove: %s: %s", name, strerror(cerr))
	}

	return nil
}
예제 #2
0
파일: object.go 프로젝트: glycerine/radosgo
// Remove deletes the named object in the pool referenced by the given context.
func (c *Context) Remove(name string) error {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	if cerr := C.rados_remove(c.ctx, cname); cerr != 0 {
		return radosReturnCodeError(cerr)
	}

	return nil
}
예제 #3
0
// Remove removes the object from the pool.
func (o *Object) Remove() error {
	oid := C.CString(o.name)
	defer freeString(oid)
	ret := C.rados_remove(o.ioContext, oid)
	if err := toRadosError(ret); err != nil {
		err.Message = fmt.Sprintf("Unable to delete object %s", o.name)
		return err
	}
	return nil
}
예제 #4
0
파일: rados_io.go 프로젝트: vuleetu/gorados
func (r *RadosIoCtx) Remove(oid string) error {
	coid := C.CString(oid)
	defer func() {
		C.free(unsafe.Pointer(coid))
	}()
	cerr := C.rados_remove(*r.ctx, coid)
	if cerr < 0 {
		return errors.New("remove object failed")
	}
	return nil
}
예제 #5
0
// Delete deletes the object with key oid. It returns an error, if any.
func (p *Pool) Delete(oid string) error {
	c_oid := C.CString(oid)
	defer C.free(unsafe.Pointer(c_oid))

	ret := C.rados_remove(p.ioctx, c_oid)

	if ret == 0 {
		return nil
	} else {
		return RadosError(int(ret))
	}
}
예제 #6
0
파일: ioctx.go 프로젝트: mittalms/go-ceph
// Delete deletes the object with key oid. It returns an error, if any.
func (ioctx *IOContext) Delete(oid string) error {
	c_oid := C.CString(oid)
	defer C.free(unsafe.Pointer(c_oid))

	return GetRadosError(C.rados_remove(ioctx.ioctx, c_oid))
}