cloudevents

package
v1.0.12 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Overview

Package cloudevents provides helpers for creating CloudEvents HTTP clients and targets that are instrumented with httpmetrics middleware.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClientHTTP

func NewClientHTTP(name string, opts ...cehttp.Option) (cloudevents.Client, error)
Example
package main

import (
	"github.com/chainguard-dev/terraform-infra-common/pkg/httpmetrics/cloudevents"
)

func main() {
	c, err := cloudevents.NewClientHTTP("my-client")
	if err != nil {
		panic(err)
	}
	_ = c
}

func WithTarget

func WithTarget(ctx context.Context, url string) []cehttp.Option

WithTarget wraps cloudevents.WithTarget to authenticate requests with an identity token when the target is an HTTPS URL.

Example
package main

import (
	"context"

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

func main() {
	ctx := context.Background()
	opts := cloudevents.WithTarget(ctx, "http://localhost:8080")
	_ = opts
}

Types

This section is empty.

Jump to

Keyboard shortcuts

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