If you want to interact with Nextcloud Talk easily in a Go project, you can use the Go Nextcloud Talk library.
You can find the godoc documentation here.
How to use
Add the library to your project
GO111MODULE=on go get gomod.garykim.dev/nc-talk
Matterbridge from version 1.18.0 onwards includes support for Nextcloud Talk. This is done using the Go Nextcloud Talk library.