search for: testpluginconnect

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

2020 Apr 21
0
Re: [PATCH nbdkit v2] Add the ability to write plugins in golang.
...error(err) return -1 } return C.int64_t(size) } > diff --git a/plugins/golang/test/test.go b/plugins/golang/test/test.go > new file mode 100644 > index 00000000..f5b1a33b > --- /dev/null > +++ b/plugins/golang/test/test.go type TestPlugin struct { nbdkit.Plugin } type TestPluginConnection struct { nbdkit.PluginConnection ...other per-connection fields... } var pluginName = "test" var size uint64 var size_set = false func (p TestPlugin) Config(key string, value string) error { if key == "size" { var err error size, err = strconv.ParseUi...
2020 Apr 21
2
[PATCH nbdkit v2] Add the ability to write plugins in golang.
Thanks: Dan Berrangé XXX UNFINISHED: - Is using uintptr for the handle a good idea? Plugins must return something != 0. In other languages we would allow plugins to return an arbitrary object here, but this is not possible in golang because of lack of GC roots. - Default can_* methods are hard to implement. Ideally we would be able to test if a user plugin implements a