Eyeson Go SDK
A golang client for the Eyeson Video Conferencing API.
info
For detailed information about the Go SDK's public API, refer to the GoDoc documentation. This documentation provides comprehensive details about all available methods, structures, and interfaces.
For a deeper understanding of the underlying API functionality that this SDK implements, please review our REST API documentation.
The complete source code for this SDK is available in our GitHub repository, where you can also find additional examples, issue tracking, and the latest updates.
Usage
package main
import (
"fmt"
"github.com/eyeson-team/eyeson-go"
)
func main() {
eyesonAPIKey := "..."
client, _ := eyeson.NewClient(eyesonAPIKey)
room, _ := client.Rooms.Join("standup meeting", "mike", map[string]string{})
fmt.Println("Join via: ", room.Data.Links.Gui)
room.WaitReady()
overlayURL := "https://eyeson-team.github.io/api/images/eyeson-overlay.png"
// Set a foreground image.
room.SetLayer(overlayURL, eyeson.Foreground, nil)
// Send a chat message.
room.Chat("Welcome!")
}
In order to receive events from the running meeting, connect on the observer socket like this:
client, _ := eyeson.NewClient(eyesonApiKey)
room, _ := client.Rooms.Join("standup meeting", "mike")
msgCh, _ := client.Observer.Connect(context.Background(), room.Data.Room.ID)
for {
select {
case msg, ok := <-msgCh:
if !ok {
fmt.Println("Channel closed. Probably disconnected")
return
}
fmt.Println("Received event type: ", msg.GetType())
switch m := msg.(type) {
case *eyeson.Chat:
fmt.Printf("Chat: %s - %s\n", m.ClientID, m.Content)
}
}
}
Development
make test # run go tests
# run an example program that starts a meeting, adds an overlay and sends
# a chat message.
API_KEY=... go run examples/meeting.go
# run an example program that listens for webhooks. please ensure the endpoint
# is public available.
API_KEY=... go run examples/webhook-listener.go <endpoint-url>