mirror of
https://github.com/kevin-DL/m3o-go.git
synced 2026-01-11 18:44:26 +00:00
23 lines
402 B
Go
Executable File
23 lines
402 B
Go
Executable File
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"go.m3o.com/mq"
|
|
)
|
|
|
|
// Publish a message. Specify a topic to group messages for a specific topic.
|
|
func main() {
|
|
mqService := mq.NewMqService(os.Getenv("M3O_API_TOKEN"))
|
|
rsp, err := mqService.Publish(&mq.PublishRequest{
|
|
Message: map[string]interface{}{
|
|
"type": "signup",
|
|
"user": "john",
|
|
"id": "1",
|
|
},
|
|
Topic: "events",
|
|
})
|
|
fmt.Println(rsp, err)
|
|
}
|