An open API service indexing awesome lists of open source software.

https://github.com/karpeleslab/spotlib

client library for spot
https://github.com/karpeleslab/spotlib

Last synced: 11 months ago
JSON representation

client library for spot

Awesome Lists containing this project

README

          

[![GoDoc](https://godoc.org/github.com/KarpelesLab/spotlib?status.svg)](https://godoc.org/github.com/KarpelesLab/spotlib)

# spotlib

Spot connection library, allows accessing Spot and sending end to end encrypted messages to other participants.

## Usage

```go
c, err := spotlib.New()
if err != nil {
return err
}
go func() {
for ev := range c.Events.On("status") {
if emmiter.Arg[int](ev, 0) == 1 {
// we are online!
}
}
}()
c.SetHandler("endpoint", func(msg *spotproto.Message) ([]byte, error) {
// handle message
...
})
```