mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-15 12:34:44 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
6
examples/event/read/curl/readEventsOnATopic.sh
Executable file
6
examples/event/read/curl/readEventsOnATopic.sh
Executable 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"
|
||||
}'
|
||||
17
examples/event/read/go/readEventsOnATopic.go
Executable file
17
examples/event/read/go/readEventsOnATopic.go
Executable 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)
|
||||
}
|
||||
12
examples/event/read/node/readEventsOnATopic.js
Executable file
12
examples/event/read/node/readEventsOnATopic.js
Executable 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();
|
||||
Reference in New Issue
Block a user