Small Python package to add GCP metadata to messages
Project description
Description
Gobits is a very small module, which acts as a metadata carrier for pub/sub messages. It automatically adds fields that may be useful downstream to determine the origin of a pub/sub message.
Usage
Cloud function with http trigger:
from gobits import Gobits
def handler(request):
bits = Gobits(request=request)
message = {
'gobits': bits,
'data': 'message-to-send'
}
Cloud function with storage trigger:
from gobits import Gobits
def handler(data, context):
bits = Gobits(context=context)
message = {
'gobits': bits,
'data': 'message-to-send'
}
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
gobits-0.0.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
gobits-0.0.1-py3-none-any.whl
(14.9 kB
view hashes)