Commit from GitHub Actions (Publish APIs & Clients)

This commit is contained in:
asim
2021-10-11 13:01:57 +00:00
parent 1d3ba793f3
commit 6ada3cd5b5
7 changed files with 7 additions and 7 deletions

View File

@@ -16,7 +16,7 @@ type FunctionService struct {
client *client.Client client *client.Client
} }
// Call a function // Call a function by name
func (t *FunctionService) Call(request *CallRequest) (*CallResponse, error) { func (t *FunctionService) Call(request *CallRequest) (*CallResponse, error) {
rsp := &CallResponse{} rsp := &CallResponse{}
return rsp, t.client.Call("function", "Call", request, rsp) return rsp, t.client.Call("function", "Call", request, rsp)

View File

@@ -6,7 +6,7 @@ export class FunctionService {
constructor(token: string) { constructor(token: string) {
this.client = new m3o.Client({ token: token }); this.client = new m3o.Client({ token: token });
} }
// Call a function // Call a function by name
call(request: CallRequest): Promise<CallResponse> { call(request: CallRequest): Promise<CallResponse> {
return this.client.call( return this.client.call(
"function", "function",

View File

@@ -11,10 +11,10 @@ func CreateArecord() {
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN")) dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := dbService.Create(&db.CreateRequest{ rsp, err := dbService.Create(&db.CreateRequest{
Record: map[string]interface{}{ Record: map[string]interface{}{
"isActive": true,
"id": "1", "id": "1",
"name": "Jane", "name": "Jane",
"age": 42, "age": 42,
"isActive": true,
}, },
Table: "users", Table: "users",
}) })

View File

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

View File

@@ -6,7 +6,7 @@ import (
"os" "os"
) )
// Call a function // Call a function by name
func CallAfunction() { func CallAfunction() {
functionService := function.NewFunctionService(os.Getenv("MICRO_API_TOKEN")) functionService := function.NewFunctionService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := functionService.Call(&function.CallRequest{ rsp, err := functionService.Call(&function.CallRequest{

View File

@@ -1,6 +1,6 @@
import * as fx from "m3o/function"; import * as fx from "m3o/function";
// Call a function // Call a function by name
async function CallAfunction() { async function CallAfunction() {
let functionService = new fx.FunctionService(process.env.MICRO_API_TOKEN); let functionService = new fx.FunctionService(process.env.MICRO_API_TOKEN);
let rsp = await functionService.call({ let rsp = await functionService.call({

View File

@@ -11,9 +11,9 @@ func PublishAmessage() {
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN")) streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
rsp, err := streamService.Publish(&stream.PublishRequest{ rsp, err := streamService.Publish(&stream.PublishRequest{
Message: map[string]interface{}{ Message: map[string]interface{}{
"id": "1",
"type": "signup", "type": "signup",
"user": "john", "user": "john",
"id": "1",
}, },
Topic: "events", Topic: "events",
}) })