Commit from GitHub Actions (Generate Clients & Examples)

This commit is contained in:
crufter
2021-11-08 15:53:57 +00:00
parent 910c0b51ce
commit b03c59cffc
6 changed files with 7 additions and 4 deletions

View File

@@ -78,5 +78,5 @@
"prepare": "npm run build" "prepare": "npm run build"
}, },
"types": "index.d.ts", "types": "index.d.ts",
"version": "1.0.656" "version": "1.0.658"
} }

View File

@@ -12,9 +12,9 @@ func PublishAnEvent() {
eventService := event.NewEventService(os.Getenv("MICRO_API_TOKEN")) eventService := event.NewEventService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := eventService.Publish(&event.PublishRequest{ rsp, err := eventService.Publish(&event.PublishRequest{
Message: map[string]interface{}{ Message: map[string]interface{}{
"user": "john",
"id": "1", "id": "1",
"type": "signup", "type": "signup",
"user": "john",
}, },
Topic: "user", Topic: "user",
}) })

View File

@@ -2,5 +2,6 @@ curl "http://localhost:8080/helloworld/Stream" \
-H "Content-Type: application/json" \ -H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \ -H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{ -d '{
"messages": 10,
"name": "John" "name": "John"
}' }'

View File

@@ -11,7 +11,8 @@ import (
func StreamsResponsesFromTheServerUsingWebsockets() { func StreamsResponsesFromTheServerUsingWebsockets() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("MICRO_API_TOKEN")) helloworldService := helloworld.NewHelloworldService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := helloworldService.Stream(&helloworld.StreamRequest{ rsp, err := helloworldService.Stream(&helloworld.StreamRequest{
Name: "John", Messages: 10,
Name: "John",
}) })
fmt.Println(rsp, err) fmt.Println(rsp, err)
} }

View File

@@ -4,6 +4,7 @@ const { HelloworldService } = require("m3o/helloworld");
async function streamsResponsesFromTheServerUsingWebsockets() { async function streamsResponsesFromTheServerUsingWebsockets() {
let helloworldService = new HelloworldService(process.env.MICRO_API_TOKEN); let helloworldService = new HelloworldService(process.env.MICRO_API_TOKEN);
let rsp = await helloworldService.stream({ let rsp = await helloworldService.stream({
messages: 10,
name: "John", name: "John",
}); });
console.log(rsp); console.log(rsp);

View File

@@ -12,9 +12,9 @@ func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN")) mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{ rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{ Message: map[string]interface{}{
"id": "1",
"type": "signup", "type": "signup",
"user": "john", "user": "john",
"id": "1",
}, },
Topic: "events", Topic: "events",
}) })