Skip to content

Commit

Permalink
Commit from GitHub Actions (Generate Clients & Examples)
Browse files Browse the repository at this point in the history
  • Loading branch information
crufter committed Nov 11, 2021
1 parent 7fa39b9 commit e80b681
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 2 deletions.
4 changes: 4 additions & 0 deletions examples/db/listTables/curl/listTables.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
curl "http://localhost:8080/db/ListTables" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{}'
15 changes: 15 additions & 0 deletions examples/db/listTables/go/listTables.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"
"os"

"github.com/micro/services/clients/go/db"
)

//
func ListTables() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.ListTables(&db.ListTablesRequest{})
fmt.Println(rsp, err)
}
10 changes: 10 additions & 0 deletions examples/db/listTables/node/listTables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { DbService } = require("m3o/db");

//
async function listTables() {
let dbService = new DbService(process.env.MICRO_API_TOKEN);
let rsp = await dbService.listTables({});
console.log(rsp);
}

listTables();
7 changes: 7 additions & 0 deletions examples/db/renameTable/curl/renameTable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
curl "http://localhost:8080/db/RenameTable" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $MICRO_API_TOKEN" \
-d '{
"from": "events",
"to": "events_backup"
}'
18 changes: 18 additions & 0 deletions examples/db/renameTable/go/renameTable.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package example

import (
"fmt"
"os"

"github.com/micro/services/clients/go/db"
)

//
func RenameTable() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.RenameTable(&db.RenameTableRequest{
From: "events",
To: "events_backup",
})
fmt.Println(rsp, err)
}
13 changes: 13 additions & 0 deletions examples/db/renameTable/node/renameTable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const { DbService } = require("m3o/db");

//
async function renameTable() {
let dbService = new DbService(process.env.MICRO_API_TOKEN);
let rsp = await dbService.renameTable({
from: "events",
to: "events_backup",
});
console.log(rsp);
}

renameTable();
2 changes: 1 addition & 1 deletion examples/event/publish/go/publishAnEvent.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ func PublishAnEvent() {
eventService := event.NewEventService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := eventService.Publish(&event.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
"id": "1",
},
Topic: "user",
})
Expand Down
2 changes: 1 addition & 1 deletion examples/mq/publish/go/publishAMessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ func PublishAmessage() {
mqService := mq.NewMqService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := mqService.Publish(&mq.PublishRequest{
Message: map[string]interface{}{
"id": "1",
"type": "signup",
"user": "john",
"id": "1",
},
Topic: "events",
})
Expand Down

0 comments on commit e80b681

Please sign in to comment.