mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-16 04:54:42 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -12,10 +12,10 @@ func CreateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.Create(&db.CreateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
"id": "1",
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
6
examples/youtube/search/curl/searchForVideos.sh
Executable file
6
examples/youtube/search/curl/searchForVideos.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
curl "https://api.m3o.com/v1/youtube/Search" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{
|
||||
"query": "donuts"
|
||||
}'
|
||||
17
examples/youtube/search/go/searchForVideos.go
Executable file
17
examples/youtube/search/go/searchForVideos.go
Executable file
@@ -0,0 +1,17 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/micro/services/clients/go/youtube"
|
||||
)
|
||||
|
||||
// Search for videos on YouTube
|
||||
func SearchForVideos() {
|
||||
youtubeService := youtube.NewYoutubeService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := youtubeService.Search(&youtube.SearchRequest{
|
||||
Query: "donuts",
|
||||
})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
12
examples/youtube/search/node/searchForVideos.js
Executable file
12
examples/youtube/search/node/searchForVideos.js
Executable file
@@ -0,0 +1,12 @@
|
||||
const { YoutubeService } = require("m3o/youtube");
|
||||
|
||||
// Search for videos on YouTube
|
||||
async function searchForVideos() {
|
||||
let youtubeService = new YoutubeService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await youtubeService.search({
|
||||
query: "donuts",
|
||||
});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
searchForVideos();
|
||||
Reference in New Issue
Block a user