mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-19 05:55:19 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
@@ -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