Sysrepo Go bindings

Go has built in support for swig but it requires manual setup and compiling takes time. A better solution is to cgo it will link against local sysrepo binaries and is easier to setup. The path to sysrepo binaries and headers can be manually setup with editing #cgo LDFLAGS: -lsysrepo which needs to be before import "C" line. The same applies to the flag for headers.

From the docker container sysrepo/sysrepo-netopeer2:devel_20161027 you can use the Go examples.

The code example used can be found here.

You can run the Go examples with:

cd /opt/dev/sysrepo
sysrepod
netopeer2-server
cd swig/golang/examples

cd application_changes_example
go build
./application_changes_example

You can watch the process in the asciinema video:

https://asciinema.org/a/90767

bindings/go (last edited 2016-10-27 13:52:37 by mnovakovic)