Commit from m3o/m3o action

This commit is contained in:
m3o-actions
2021-11-02 14:08:59 +00:00
parent abbc8bcd49
commit 716231b211
17 changed files with 574 additions and 574 deletions

View File

@@ -4,33 +4,6 @@ An [m3o.com](https://m3o.com) API. For example usage see [m3o.com/Event/api](htt
Endpoints:
## Subscribe
Subscribe to messages for a given topic.
[https://m3o.com/event/api#Subscribe](https://m3o.com/event/api#Subscribe)
```go
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)
}
```
## Publish
Publish a message to the event. Specify a topic to group messages for a specific topic.
@@ -63,3 +36,30 @@ Topic: "user",
fmt.Println(rsp, err)
}
```
## Subscribe
Subscribe to messages for a given topic.
[https://m3o.com/event/api#Subscribe](https://m3o.com/event/api#Subscribe)
```go
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)
}
```