Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2022-02-20 12:36:15 +00:00
parent 2f40c45092
commit facb2a9289
32 changed files with 1886 additions and 1414 deletions

View File

@@ -0,0 +1,30 @@
package main
import (
"fmt"
"os"
"go.m3o.com/comments"
)
// Subscribe to comments events
func main() {
commentsService := comments.NewCommentsService(os.Getenv("M3O_API_TOKEN"))
stream, err := commentsService.Events(&comments.EventsRequest{
Id: "63c0cdf8-2121-11ec-a881-0242e36f037a",
})
if err != nil {
fmt.Println(err)
return
}
for {
rsp, err := stream.Recv()
if err != nil {
fmt.Println(err)
return
}
fmt.Println(rsp)
}
}