@@ -23,8 +23,8 @@ Prepare a context as follows, name it `function.json`. (You can refer to [OpenFu
23
23
"inputs" : {
24
24
"cron" : {
25
25
"uri" : " cron_input" ,
26
- "type " : " bindings" ,
27
- "component " : " cron_input"
26
+ "componentType " : " bindings.cron " ,
27
+ "componentName " : " cron_input"
28
28
}
29
29
},
30
30
"outputs" : {},
@@ -37,7 +37,8 @@ Prepare a context as follows, name it `function.json`. (You can refer to [OpenFu
37
37
Create an environment variable ` FUNC_CONTEXT ` and assign the above context to it.
38
38
39
39
``` shell
40
- export FUNC_CONTEXT=' {"name":"bindings","version":"v1","requestID":"a0f2ad8d-5062-4812-91e9-95416489fb01","port":"50002","inputs":{"cron":{"uri":"cron_input","type":"bindings","component":"cron_input"}},"outputs":{},"runtime":"Async","prePlugins":["plugin-custom","plugin-example"],"postPlugins":["plugin-custom","plugin-example"]}'
40
+ export FUNC_CONTEXT=' {"name":"bindings","version":"v1","requestID":"a0f2ad8d-5062-4812-91e9-95416489fb01","port":"50002","inputs":{"cron":{"uri":"cron_input","componentType":"bindings.cron","componentName":"cron_input"}},"outputs":{},"runtime":"Async","prePlugins":["plugin-custom","plugin-example"],"postPlugins":["plugin-custom","plugin-example"]}'
41
+ export CONTEXT_MODE=' self-host'
41
42
```
42
43
43
44
### Run
@@ -52,7 +53,7 @@ dapr run --app-id bindings_grpc \
52
53
--app-port 50002 \
53
54
--dapr-grpc-port 50001 \
54
55
--components-path ../../components \
55
- go run ./main.go ./plugin.go
56
+ go run ./main.go
56
57
```
57
58
58
59
## Bindings with output
@@ -100,20 +101,20 @@ In this example, the proxy address of Dapr will be used as the target of output.
100
101
"inputs" : {
101
102
"cron" : {
102
103
"uri" : " cron_input" ,
103
- "type " : " bindings" ,
104
- "component " : " cron_input"
104
+ "componentType " : " bindings.cron " ,
105
+ "componentName " : " cron_input"
105
106
}
106
107
},
107
108
"outputs" : {
108
109
"echo" : {
109
110
"uri" : " echo" ,
110
111
"operation" : " create" ,
111
- "component " : " echo" ,
112
+ "componentName " : " echo" ,
112
113
"metadata" : {
113
114
"path" : " echo" ,
114
115
"Content-Type" : " application/json; charset=utf-8"
115
116
},
116
- "type " : " bindings"
117
+ "componentType " : " bindings.http "
117
118
}
118
119
},
119
120
"runtime" : " Async" ,
@@ -125,7 +126,8 @@ In this example, the proxy address of Dapr will be used as the target of output.
125
126
Create an environment variable ` FUNC_CONTEXT ` and assign the above context to it.
126
127
127
128
``` shell
128
- export FUNC_CONTEXT=' {"name":"bindings","version":"v1","requestID":"a0f2ad8d-5062-4812-91e9-95416489fb01","port":"50002","inputs":{"cron":{"uri":"cron_input","type":"bindings","component":"cron_input"}},"outputs":{"echo":{"uri":"echo","operation":"create","component":"echo","metadata":{"path":"echo","Content-Type":"application/json; charset=utf-8"},"type":"bindings"}},"runtime":"Async","prePlugins":["plugin-custom","plugin-example"],"postPlugins":["plugin-custom","plugin-example"]}'
129
+ export FUNC_CONTEXT=' {"name":"bindings","version":"v1","requestID":"a0f2ad8d-5062-4812-91e9-95416489fb01","port":"50002","inputs":{"cron":{"uri":"cron_input","componentType":"bindings.cron","componentName":"cron_input"}},"outputs":{"echo":{"uri":"echo","operation":"create","componentName":"echo","metadata":{"path":"echo","Content-Type":"application/json; charset=utf-8"},"componentType":"bindings.http"}},"runtime":"Async","prePlugins":["plugin-custom","plugin-example"],"postPlugins":["plugin-custom","plugin-example"]}'
130
+ export CONTEXT_MODE=' self-host'
129
131
```
130
132
131
133
### Run
@@ -139,7 +141,7 @@ dapr run --app-id bindings_grpc \
139
141
--app-port 50002 \
140
142
--dapr-grpc-port 50001 \
141
143
--components-path ../../components \
142
- go run ./main.go ./plugin.go
144
+ go run ./main.go
143
145
```
144
146
145
147
0 commit comments