Commit from GitHub Actions (Publish APIs & Clients)

This commit is contained in:
crufter
2021-09-16 11:56:07 +00:00
parent d4d9c1c176
commit 83ae3b6f39
12 changed files with 313 additions and 6 deletions

View File

@@ -11,10 +11,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,
"isActive": true,
},
Table: "users",
})

View File

@@ -11,8 +11,8 @@ func UpdateArecord() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.Update(&db.UpdateRequest{
Record: map[string]interface{}{
"age": 43,
"id": "1",
"age": 43,
},
Table: "users",
})

View File

@@ -0,0 +1,7 @@
curl "https://api.m3o.com/v1/twitter/Timeline" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"limit": 1,
"username": "m3oservices"
}'

View File

@@ -0,0 +1,17 @@
package example
import (
"fmt"
"github.com/micro/services/clients/go/twitter"
"os"
)
// Get the timeline for a given user
func GetAtwitterTimeline() {
twitterService := twitter.NewTwitterService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := twitterService.Timeline(&twitter.TimelineRequest{
Limit: 1,
Username: "m3oservices",
})
fmt.Println(rsp, err)
}

View File

@@ -0,0 +1,13 @@
import * as twitter from "m3o/twitter";
// Get the timeline for a given user
async function GetAtwitterTimeline() {
let twitterService = new twitter.TwitterService(process.env.MICRO_API_TOKEN);
let rsp = await twitterService.timeline({
limit: 1,
username: "m3oservices",
});
console.log(rsp);
}
await GetAtwitterTimeline();