Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-11-02 16:43:32 +00:00
parent 114660a002
commit 8623e7fec8
4 changed files with 73 additions and 34 deletions

View File

@@ -0,0 +1,22 @@
package example
import (
"fmt"
"os"
"go.m3o.com/event"
)
// Publish a event to the event stream.
func PublishAnEvent() {
eventService := event.NewEventService(os.Getenv("M3O_API_TOKEN"))
rsp, err := eventService.Publish(&event.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
},
Topic: "user",
})
fmt.Println(rsp, err)
}