pubsub

package
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package pubsub provides helpers for converting CloudEvents to and from Google Cloud Pub/Sub messages.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromCloudEvent

func FromCloudEvent(_ context.Context, event cloudevents.Event) *pubsub.Message
Example
package main

import (
	"context"

	cloudevents "github.com/cloudevents/sdk-go/v2"

	"github.com/chainguard-dev/terraform-infra-common/pkg/pubsub"
)

func main() {
	ctx := context.Background()
	event := cloudevents.NewEvent()
	event.SetID("example-id")
	event.SetSource("example/source")
	event.SetType("example.type")

	msg := pubsub.FromCloudEvent(ctx, event)
	_ = msg
}

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL