Scope
indicates which functions-framework has already support this item.
OpenFunction/functions-framework-go -> ff-go
OpenFunction/functions-framework-nodejs -> ff-js
Example:
{
"name": "function",
"version": "v1",
"requestID": "a0f2ad8d-5062-4812-91e9-95416489fb01",
"port": "50002",
"input": {},
"outputs": {},
"runtime": "OpenFuncAsync",
"state": ""
}
Specification:
Key | Type | Description | Scope | example |
---|---|---|---|---|
name | string, require | Function name. | ff-go | "myfunction", "hello-func" |
version | string, require | Function version. | ff-go | "v1", "v2" |
requestID | string | Request ID, uuid format. | ff-go | "a0f2ad8d-5062-4812-91e9-95416489fb01" |
port | string, require | Function serving port. | ff-go | "50001" |
input | object | Function input from bindings data, see Input. Empty means no input. | ff-go, ff-js | |
outputs | map | Function output to bindings data. A map of Output objects. The key is the name of output. When using OpenFuncAsync as runtime, this name needs to be consistent with the corresponding Dapr component resource name. Refer to this docs to learn about Dapr components. The value is output object, see Output. Empty means no output. |
ff-go, ff-js | |
runtime | enum, require | Function serving runtime, see Runtime. | ff-go | "Knative", "OpenFuncAsync" |
state | string | Used to store the states of the function in operation. |
Example:
{
"name": "my_input",
"uri": "my_topic",
"params": {
"type": "pubsub"
}
}
Specification:
Key | Type | Description | Scope | example |
---|---|---|---|---|
name | string | Input name. When using OpenFuncAsync as runtime, this name needs to be consistent with the corresponding Dapr component resource name. Refer to this docs to learn about Dapr components. | ff-go, ff-js | "demo-kafka", "cron-job" |
uri | string | Input serving listening path. This indicates the destination of the input data. | ff-go, ff-js | "echo" |
params | map | Input params. When using OpenFuncAsync as runtime, you need to set the type (refer to Input Type) parameter. |
ff-go, ff-js | {"type": "pubsub"} |
Effective only when using OpenFuncAsync as runtime.
Value | Description | Scope |
---|---|---|
bindings | Indicates that the input is the Dapr bindings component. Refer to Bindings API reference to learn more about Dapr bindings components. | ff-go |
pubsub | Indicates that the input is the Dapr pubsub component. Refer to Pub/sub API reference to learn more about Dapr bindings components. ❗Note that when using pubsub as input, the name of pubsub's topic should be assigned to the input's uri. |
ff-go, ff-js |
invoke | Indicates that the input is the Dapr service invocation component. Refer to Service invocation API reference to learn more about Dapr bindings components. ❗Note that when using invoke as input, the name of invoke method should be assigned to the input's uri. |
ff-go, ff-js |
Examples:
{
"my_output": {
"uri": "print",
"params": {
"method": "post",
"type": "invoke"
}
}
}
Specification:
Key | Type | Description | Scope | example |
---|---|---|---|---|
uri | string | Output serving listening path. This indicates the destination of the out data. | ff-go, ff-js | "echo" |
params | map | When using OpenFuncAsync as runtime, you need to set the type (refer to Output Type) parameter. You also need to set other relevant parameters according to Dapr's docs. |
ff-go, ff-js | {"method": "post"}, {"operation": "create"} |
Effective only when using OpenFuncAsync as runtime.
Value | Description | Scope |
---|---|---|
bindings | Indicates that the output is the Dapr bindings component. Refer to Bindings API reference to learn more about Dapr bindings components. | ff-go |
pubsub | Indicates that the output is the Dapr pubsub component. Refer to Pub/sub API reference to learn more about Dapr bindings components. ❗Note that when using pubsub as output, the name of pubsub's topic should be assigned to the output's uri. |
ff-go, ff-js |
invoke | Indicates that the output is the Dapr service invocation component. Refer to Service invocation API reference to learn more about Dapr bindings components. ❗Note that when using invoke as output, the name of invoke method should be assigned to the output's uri. |
ff-go, ff-js |
We currently support Knative
and OpenFuncAsync
serving runtime.
Value | Description | Scope |
---|---|---|
Knative | Serving function with Knative runtime (based on Knative). | ff-go |
OpenFuncAsync | Serving function with OpenFuncAsync runtime (based on KEDA+Dapr). | ff-go |