mirror of
https://github.com/kevin-DL/services.git
synced 2026-01-12 11:15:12 +00:00
Function service (#227)
This commit is contained in:
4
examples/function/list/curl/listFunctions.sh
Executable file
4
examples/function/list/curl/listFunctions.sh
Executable file
@@ -0,0 +1,4 @@
|
||||
curl "https://api.m3o.com/v1/function/List" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer $MICRO_API_TOKEN" \
|
||||
-d '{}'
|
||||
14
examples/function/list/go/listFunctions.go
Executable file
14
examples/function/list/go/listFunctions.go
Executable file
@@ -0,0 +1,14 @@
|
||||
package example
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/micro/services/clients/go/function"
|
||||
"os"
|
||||
)
|
||||
|
||||
//
|
||||
func ListFunctions() {
|
||||
functionService := function.NewFunctionService(os.Getenv("MICRO_API_TOKEN"))
|
||||
rsp, err := functionService.List(&function.ListRequest{})
|
||||
fmt.Println(rsp, err)
|
||||
}
|
||||
10
examples/function/list/node/listFunctions.js
Executable file
10
examples/function/list/node/listFunctions.js
Executable file
@@ -0,0 +1,10 @@
|
||||
import * as fx from "m3o/function";
|
||||
|
||||
//
|
||||
async function ListFunctions() {
|
||||
let functionService = new fx.FunctionService(process.env.MICRO_API_TOKEN);
|
||||
let rsp = await functionService.list({});
|
||||
console.log(rsp);
|
||||
}
|
||||
|
||||
await ListFunctions();
|
||||
Reference in New Issue
Block a user