Commit from GitHub Actions (Generate Clients & Examples)

This commit is contained in:
asim
2021-11-02 16:30:37 +00:00
parent 636f5f1758
commit acf15882f4
5 changed files with 71 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
curl "https://api.m3o.com/v1/event/Read" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"topic": "user"
}'

View File

@@ -0,0 +1,17 @@
package example
import (
"fmt"
"os"
"github.com/micro/services/clients/go/event"
)
// Read stored events
func ReadEventsOnAtopic() {
eventService := event.NewEventService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := eventService.Read(&event.ReadRequest{
Topic: "user",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,12 @@
const { EventService } = require("m3o/event");
// Read stored events
async function readEventsOnAtopic() {
let eventService = new EventService(process.env.MICRO_API_TOKEN);
let rsp = await eventService.read({
topic: "user",
});
console.log(rsp);
}
readEventsOnAtopic();