Exemple #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
}
Exemple #2
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 radosReturnCodeError(cerr)
	}

	return nil
}
Exemple #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
}
Exemple #4
0
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
}
Exemple #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))
	}
}
Exemple #6
0
// 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))
}