mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-20 06:25:07 +00:00
Commit from GitHub Actions (Generate Clients & Examples)
This commit is contained in:
4
examples/stream/listChannels/curl/listChannels.sh
Executable file
4
examples/stream/listChannels/curl/listChannels.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
curl "https://api.m3o.com/v1/stream/ListChannels" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{}'
|
||||
15
examples/stream/listChannels/go/listChannels.go
Executable file
15
examples/stream/listChannels/go/listChannels.go
Executable file
@@ -0,0 +1,15 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/stream"
|
||||
)
|
||||
|
||||
// List all the active channels
|
||||
func ListChannels() {
|
||||
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := streamService.ListChannels(&stream.ListChannelsRequest{})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
10
examples/stream/listChannels/node/listChannels.js
Executable file
10
examples/stream/listChannels/node/listChannels.js
Executable file
@@ -0,0 +1,10 @@
|
||||
const { StreamService } = require("m3o/stream");
|
||||
|
||||
// List all the active channels
|
||||
async function listChannels() {
|
||||
let streamService = new StreamService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await streamService.listChannels({});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
listChannels();
|
||||
Reference in New Issue
Block a user