Commit from GitHub Actions (Generate Clients & Examples)

This commit is contained in:
asim
2021-11-03 17:01:33 +00:00
parent 8f42e94d11
commit 2b1122711f
5 changed files with 37 additions and 2 deletions

View File

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

View File

@@ -12,10 +12,10 @@ func CreateArecord() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.Create(&db.CreateRequest{
Record: map[string]interface{}{
"age": 42,
"isActive": true,
"id": "1",
"name": "Jane",
"age": 42,
},
Table: "users",
})

View File

@@ -0,0 +1,6 @@
curl "https://api.m3o.com/v1/helloworld/Stream" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"name": "John"
}'

View File

@@ -0,0 +1,17 @@
package example
import (
"fmt"
"os"
"github.com/micro/services/clients/go/helloworld"
)
// Stream returns a stream of "Hello $name" responses
func StreamsResponsesFromTheServerUsingWebsockets() {
helloworldService := helloworld.NewHelloworldService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := helloworldService.Stream(&helloworld.StreamRequest{
Name: "John",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,12 @@
const { HelloworldService } = require("m3o/helloworld");
// Stream returns a stream of "Hello $name" responses
async function streamsResponsesFromTheServerUsingWebsockets() {
let helloworldService = new HelloworldService(process.env.MICRO_API_TOKEN);
let rsp = await helloworldService.stream({
name: "John",
});
console.log(rsp);
}
streamsResponsesFromTheServerUsingWebsockets();