mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-12 10:55:11 +00:00
18 lines
308 B
Go
Executable File
18 lines
308 B
Go
Executable File
package example
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/event"
|
|
)
|
|
|
|
// Subscribe to messages for a given topic.
|
|
func SubscribeToAtopic() {
|
|
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := eventService.Subscribe(&event.SubscribeRequest{
|
|
Topic: "user",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|