Go to file
wss-git ea689b8623
Merge pull request #6 from devsapp/wss/fc-endpoint
feat: support custom fc-endpoint when create fc client
2021-08-03 10:28:26 +08:00
.github/workflows feat: init repo 2021-06-01 15:29:39 +08:00
doc refactor: v0.0.13 2021-07-28 10:14:57 +08:00
example refactor: version 0.0.7 2021-06-09 11:15:08 +08:00
lib refactor: v0.0.12 2021-07-16 17:20:05 +08:00
locales refactor: version 0.0.11 2021-07-05 10:44:32 +08:00
src feat: support custom fc-endpoint when create fc client 2021-07-29 09:40:29 +08:00
.gitignore feat: init repo 2021-06-01 15:29:39 +08:00
.prettierrc.js feat: init repo 2021-06-01 15:29:39 +08:00
.signore feat: init repo 2021-06-01 15:29:39 +08:00
LICENSE feat: init repo 2021-06-01 15:29:39 +08:00
README.md fix: help 2021-06-09 18:35:00 +08:00
package.json refactor: v0.0.13 2021-07-28 10:14:57 +08:00
publish.yaml refactor: v0.0.13 2021-07-28 10:14:57 +08:00
tsconfig.json feat: init repo 2021-06-01 15:29:39 +08:00

README.md

组件说明

fc-remote-invoke 组件调用 FC 函数。

带有 YAML 文件用法

yaml 配置

edition: 1.0.0        #  命令行YAML规范版本遵循语义化版本Semantic Versioning规范
name: compoent-test   #  项目名称

services:
  component-test:
    component: devsapp/fc-remote-invoke  # 这里引入的是相对路径正式配置替换成你自己的component名称即可 
    props:
      region: ${region}
      serviceName: ${serviceName}
      functionName: ${functionName}

函数调用

$ s exec -- invoke --invocation-type sync --event ${payload}
$ s exec -- invoke --invocation-type async --event-file ${path}
$ s exec -- invoke --event-stdin

CLI 用法

$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --invocation-type sync --event ${payload}
$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --invocation-type async --event-file ${path}
$ s cli fc-remote-invoke invoke --region * --service-name * --function-name * --event-stdin

特别说明

当函数是 http 函数时event最终获取值目前仅支持 json 字符串,示例参考

{
  "body": "body",
  "method": "POST",
  "headers": {
    "key": "value"
  },
  "queries": {
    "key": "value"
  },
  "path": "string"
}

invocation-type 选填,默认 sync event 选填event 函数默认为空字符串http 函数默认 GET 请求,其他参数为空