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
cd swig/golang/examples

cd application_changes_example
go build

You can watch the process in the asciinema video:

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