On Sun, Nov 15, 2015 at 1:02 AM, Yonghua Peng <p...@cloud-china.org> wrote:
> Hello,
>
> There are ruby/java/python/go ports for librbd (ceph's rados block device,
> see ceph.com), but there isn't perl's.
>
> For example,
>
> python's -
> https://github.com/ceph/ceph/blob/v0.48.2argonaut/src/pybind/rbd.py
>
> ruby's -
> https://github.com/ceph/ceph-ruby/blob/master/lib/ceph-ruby/lib/rbd.rb
>
> Can you show me how to ports that into perl language? I just want to create
> a module called Ceph::Lib::Rbd.

There isn't one single way, and unfortunately there isn't an exact
guide that shows how to write any possible bindings.

You can use the following guides:
* http://perldoc.perl.org/perlxs.html
* http://www.lemoda.net/xs/index.html
* https://github.com/xsawyerx/xs-fun/

You will need to think of the interface. For example, the questions:
* How will the API look like?
* Should I use objects?
* Do I use "magic" to store the details?
* etc.

Otherwise, great stuff. Good luck! :)

Reply via email to