Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oklahomer/go-sarah-xmpp
go-sarah adapter for xmpp integration
https://github.com/oklahomer/go-sarah-xmpp
ejabberd hipchat-bot xmpp
Last synced: 14 days ago
JSON representation
go-sarah adapter for xmpp integration
- Host: GitHub
- URL: https://github.com/oklahomer/go-sarah-xmpp
- Owner: oklahomer
- Created: 2018-05-02T08:52:47.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-07T01:23:21.000Z (over 5 years ago)
- Last Synced: 2024-11-02T03:42:26.449Z (2 months ago)
- Topics: ejabberd, hipchat-bot, xmpp
- Language: Go
- Homepage: https://godoc.org/github.com/oklahomer/go-sarah-xmpp
- Size: 26.4 KB
- Stars: 2
- Watchers: 3
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This is a [sarah](https://github.com/oklahomer/go-sarah) ```Adapter``` implementation for XMPP / Jabber
At present this is work in progress, and API may change without notice.
# Getting Started
Below is a minimal sample that describes how to setup and start XMPP Adapter.```go
package mainimport (
"github.com/oklahomer/go-sarah"
"github.com/oklahomer/go-sarah-xmpp"
"golang.org/x/net/context"
"gopkg.in/yaml.v2"
"io/ioutil"
)func main() {
// Setup configuration
configBuf, _ := ioutil.ReadFile("/path/to/adapter/config.yaml")
xmppConfig := xmpp.NewConfig()
yaml.Unmarshal(configBuf, xmppConfig)// Setup bot
xmppAdapter, _ := xmpp.NewAdapter(xmppConfig)
storage := sarah.NewUserContextStorage(sarah.NewCacheConfig())
xmppBot, _ := sarah.NewBot(xmppAdapter, sarah.BotWithStorage(storage))
// Start
rootCtx := context.Background()
runnerCtx, _ := context.WithCancel(rootCtx)
runner, _ := sarah.NewRunner(sarah.NewConfig(), sarah.WithBot(xmppBot))
runner.Run(runnerCtx)
}
```## Acknowledgements and thanks
This library uses the excellent xmpp library - https://github.com/mattn/go-xmpp