- Use C errno constants in place of hardcoded ints
- Use type inference where possible (especially C.CString
- Don't explicitly specify zero values where value would be default anway
- Rewrap some unnecessarily wrapped short lines
- Use if/else one-liners where value is not needed afterwards
Signed-off-by: Daniel Swarbrick <daniel.swarbrick@gmail.com>
ioctx.read should contact the cluster even when its slice is empty so
that errors like ENOENT can be reported.
Signed-off-by: Noah Watkins <nwatkins@redhat.com>
the problem was that the C-API was returning an error, but the error
pointer (from the op) was getting -EIO. That makes sense as the outer
error was resulting in junk being decode somewhere.
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
The current IOContext struct has a ListObjects() method that works well for
pools with a reasonable number of objects. However, for very large pools, having
finer control over the iteration may be desirable.
This commit adds a new Iter() interface for pools. It allows callers to stop
iterating at any time by issuing a iter.Close(). It also allows callers to
"Seek" into the pool list using a token object.
In Go, the "C" package is a special type of package that creates local symbols
names (non exportable) to the importing package. The result, in the case of
rados.GetRadosError() is that trying to use results in:
cannot use cerr (type C.int) as type rados.C.int in argument to rados.GetRadosError
It seems that "C.int" within 'rados' namespace produces a symbol of the type
`_Ctype_int`, which given it's first character `_` is not exported. As such, we
have the type being defined as `rados._Ctype_int`, which is not accessible
outside of the rados package.
This commit changes the interface to use the native Go `int` type.
* `ListOmapValues` allows to iterate on all the key feteched during
a read operation of an omap (the goal is to easily get the last
read key from the C iterator. This one can then be used in another
call as `startAfter` parameter).
* `GetAllOmapValues` returns all the keys / values of the whole omap
* `GetOmapValues` now uses `ListOmapValues`
Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
Added a function to List Xattrs, which returns a map of all xattrs set
on an object, errors out otherwise
Signed-off-by: Abhishek Lekshmanan <abhishek.lekshmanan@gmail.com>