You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7-37Lines changed: 7 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ pip install functions-framework
45
45
Or, for deployment, add the Functions Framework to your `requirements.txt` file:
46
46
47
47
```
48
-
functions-framework==2.0.0
48
+
functions-framework==1.5.0
49
49
```
50
50
51
51
# Quickstart: Hello, World on your local machine
@@ -129,57 +129,27 @@ You can configure the Functions Framework using command-line flags or environmen
129
129
|`--host`|`HOST`| The host on which the Functions Framework listens for requests. Default: `0.0.0.0`|
130
130
|`--port`|`PORT`| The port on which the Functions Framework listens for requests. Default: `8080`|
131
131
|`--target`|`FUNCTION_TARGET`| The name of the exported function to be invoked in response to requests. Default: `function`|
132
-
|`--signature-type`|`FUNCTION_SIGNATURE_TYPE`| The signature used when writing your function. Controls unmarshalling rules and determines which arguments are used to invoke your function. Default: `http`; accepted values: `http` or `event`or `cloudevent`|
132
+
|`--signature-type`|`FUNCTION_SIGNATURE_TYPE`| The signature used when writing your function. Controls unmarshalling rules and determines which arguments are used to invoke your function. Default: `http`; accepted values: `http` or `event`|
133
133
|`--source`|`FUNCTION_SOURCE`| The path to the file containing your function. Default: `main.py` (in the current working directory) |
134
134
|`--debug`|`DEBUG`| A flag that allows to run functions-framework to run in debug mode, including live reloading. Default: `False`|
135
135
136
+
# Enable CloudEvents
136
137
137
-
# Enable Google Cloud Functions Events
138
-
139
-
The Functions Framework can unmarshall incoming
140
-
Google Cloud Functions [event](https://cloud.google.com/functions/docs/concepts/events-triggers#events) payloads to `data` and `context` objects.
141
-
These will be passed as arguments to your function when it receives a request.
142
-
Note that your function must use the `event`-style function signature:
143
-
138
+
The Functions Framework can unmarshall incoming [CloudEvents](http://cloudevents.io) payloads to `data` and `context` objects. These will be passed as arguments to your function when it receives a request. Note that your function must use the event-style function signature:
144
139
145
140
```python
146
141
defhello(data, context):
147
142
print(data)
148
143
print(context)
149
144
```
150
145
151
-
To enable automatic unmarshalling, set the function signature type to `event`
152
-
using a command-line flag or an environment variable. By default, the HTTP
153
-
signature will be used and automatic event unmarshalling will be disabled.
154
-
155
-
For more details on this signature type, check out the Google Cloud Functions
See the [running example](examples/cloud_run_event).
160
-
161
-
# Enable CloudEvents
162
-
163
-
The Functions Framework can unmarshall incoming
164
-
[CloudEvent](http://cloudevents.io) payloads to a `cloudevent` object.
165
-
It will be passed as an argument to your function when it receives a request.
166
-
Note that your function must use the `cloudevent`-style function signature
167
-
168
-
169
-
```python
170
-
defhello(cloudevent):
171
-
print("Received event with ID: %s"% cloudevent.EventID())
172
-
return200
173
-
```
174
-
175
-
To enable automatic unmarshalling, set the function signature type to `cloudevent` using the `--signature-type` command-line flag or the `FUNCTION_SIGNATURE_TYPE` environment variable. By default, the HTTP signature type will be used and automatic event unmarshalling will be disabled.
146
+
To enable automatic unmarshalling, set the function signature type to `event` using the `--signature-type` command-line flag or the `FUNCTION_SIGNATURE_TYPE` environment variable. By default, the HTTP signature type will be used and automatic event unmarshalling will be disabled.
176
147
177
-
See the [running example](examples/cloud_run_cloudevents).
148
+
For more details on this signature type, check out the Google Cloud Functions documentation on [background functions](https://cloud.google.com/functions/docs/writing/background#cloud_pubsub_example).
178
149
179
150
# Advanced Examples
180
151
181
-
More advanced guides can be found in the [`examples/`](./examples/) directory. You can also find examples
182
-
on using the CloudEvent Python SDK [here](https://github.com/cloudevents/sdk-python).
152
+
More advanced guides can be found in the [`examples/`](./examples/) directory.
*[`cloud_run_http`](./cloud_run_http/) - Deploying an HTTP function to [Cloud Run](http://cloud.google.com/run) with the Functions Framework
4
-
*[`cloud_run_event`](./cloud_run_event/) - Deploying a [Google Cloud Functions Event](https://cloud.google.com/functions/docs/concepts/events-triggers#events) function to [Cloud Run](http://cloud.google.com/run) with the Functions Framework
5
-
*[`cloud_run_cloudevents`](./cloud_run_cloudevents/) - Deploying a [CloudEvent](https://github.com/cloudevents/sdk-python) function to [Cloud Run](http://cloud.google.com/run) with the Functions Framework
4
+
*[`cloud_run_event`](./cloud_run_event/) - Deploying a CloudEvent function to [Cloud Run](http://cloud.google.com/run) with the Functions Framework
Copy file name to clipboardExpand all lines: setup.py
+1-2Lines changed: 1 addition & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@
25
25
26
26
setup(
27
27
name="functions-framework",
28
-
version="2.0.0",
28
+
version="1.5.0",
29
29
description="An open source FaaS (Function as a service) framework for writing portable Python functions -- brought to you by the Google Cloud Functions team.",
0 commit comments