search for: plugingetsize

Displaying 2 results from an estimated 2 matches for "plugingetsize".

Did you mean: plugin_get_size
2020 Apr 10
0
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
...ck") + // Cannot return a golang pointer, need to allocate a C obj. + return unsafe.Pointer(C.CString("hello")) +} + +//export pluginClose +func pluginClose(handle unsafe.Pointer) { + nbdkit.Debug("golang code running in the .close callback") + C.free(handle) +} + +//export pluginGetSize +func pluginGetSize(handle unsafe.Pointer) C.int64_t { + nbdkit.Debug("golang code running in the .get_size callback") + return 1024 * 1024 +} + +//export pluginPRead +func pluginPRead(handle unsafe.Pointer, buf []byte, count C.uint32_t, + offset C.uint64_t, flags C.uint32_t) C.int { + nb...
2020 Apr 10
3
[PATCH nbdkit UNFINISHED] Add the ability to write plugins in golang.
Sorry Dan, but I really do dislike golang with a passion :-) Here is a patch that allows you to write nbdkit plugins in golang. As with C, OCaml and Rust, you can write a plugin in Go which compiles directly to a .so file that can be loaded into golang, so in that sense it works completely differently from scripting language plugins like Perl and Python where there's an