mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-23 15:51:24 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
@@ -78,5 +78,5 @@
|
|||||||
"prepare": "npm run build"
|
"prepare": "npm run build"
|
||||||
},
|
},
|
||||||
"types": "index.d.ts",
|
"types": "index.d.ts",
|
||||||
"version": "1.0.622"
|
"version": "1.0.624"
|
||||||
}
|
}
|
||||||
@@ -12,10 +12,10 @@ func CreateArecord() {
|
|||||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||||
rsp, err := dbService.Create(&db.CreateRequest{
|
rsp, err := dbService.Create(&db.CreateRequest{
|
||||||
Record: map[string]interface{}{
|
Record: map[string]interface{}{
|
||||||
|
"age": 42,
|
||||||
"isActive": true,
|
"isActive": true,
|
||||||
"id": "1",
|
"id": "1",
|
||||||
"name": "Jane",
|
"name": "Jane",
|
||||||
"age": 42,
|
|
||||||
},
|
},
|
||||||
Table: "users",
|
Table: "users",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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"
|
||||||
|
}'
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
@@ -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();
|
||||||
Reference in New Issue
Block a user