Skip to main content

Small Python package to add GCP metadata to pub/sub 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


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.3.tar.gz (2.3 kB view hashes)

Uploaded Source

Built Distribution

gobits-0.0.3-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page