mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-11 19:04:35 +00:00
Commit from GitHub Actions (Publish APIs & Clients)
This commit is contained in:
@@ -16,7 +16,7 @@ type FunctionService struct {
|
||||
client *client.Client
|
||||
}
|
||||
|
||||
// Call a function
|
||||
// Call a function by name
|
||||
func (t *FunctionService) Call(request *CallRequest) (*CallResponse, error) {
|
||||
rsp := &CallResponse{}
|
||||
return rsp, t.client.Call("function", "Call", request, rsp)
|
||||
|
||||
@@ -6,7 +6,7 @@ export class FunctionService {
|
||||
constructor(token: string) {
|
||||
this.client = new m3o.Client({ token: token });
|
||||
}
|
||||
// Call a function
|
||||
// Call a function by name
|
||||
call(request: CallRequest): Promise<CallResponse> {
|
||||
return this.client.call(
|
||||
"function",
|
||||
|
||||
@@ -11,10 +11,10 @@ func CreateArecord() {
|
||||
dbService := db.NewDbService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := dbService.Create(&db.CreateRequest{
|
||||
Record: map[string]interface{}{
|
||||
"isActive": true,
|
||||
"id": "1",
|
||||
"name": "Jane",
|
||||
"age": 42,
|
||||
"isActive": true,
|
||||
},
|
||||
Table: "users",
|
||||
})
|
||||
|
||||
@@ -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",
|
||||
})
|
||||
|
||||
@@ -6,7 +6,7 @@ import (
|
||||
"os"
|
||||
)
|
||||
|
||||
// Call a function
|
||||
// Call a function by name
|
||||
func CallAfunction() {
|
||||
functionService := function.NewFunctionService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := functionService.Call(&function.CallRequest{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as fx from "m3o/function";
|
||||
|
||||
// Call a function
|
||||
// Call a function by name
|
||||
async function CallAfunction() {
|
||||
let functionService = new fx.FunctionService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await functionService.call({
|
||||
|
||||
@@ -11,9 +11,9 @@ func PublishAmessage() {
|
||||
streamService := stream.NewStreamService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := streamService.Publish(&stream.PublishRequest{
|
||||
Message: map[string]interface{}{
|
||||
"id": "1",
|
||||
"type": "signup",
|
||||
"user": "john",
|
||||
"id": "1",
|
||||
},
|
||||
Topic: "events",
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user