extensions

package
v2.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2025 License: Apache-2.0 Imports: 6 Imported by: 14

Documentation

Overview

Package extensions provides implementations of common event extensions.

Index

Constants

View Source
const (
	TraceParentExtension = "traceparent"
	TraceStateExtension  = "tracestate"
)
View Source
const DataRefExtensionKey = "dataref"

Variables

This section is empty.

Functions

func AddDataRefExtension added in v2.16.0

func AddDataRefExtension(e *event.Event, dataRef string) error

AddDataRefExtension adds the dataref attribute to the cloudevents context

Types

type DataRefExtension added in v2.16.0

type DataRefExtension struct {
	DataRef string `json:"dataref"`
}

DataRefExtension represents the CloudEvents Dataref (claim check pattern) extension for cloudevents contexts, See https://github.com/cloudevents/spec/blob/main/cloudevents/extensions/dataref.md for more info

func GetDataRefExtension added in v2.16.0

func GetDataRefExtension(e event.Event) (DataRefExtension, bool)

GetDataRefExtension returns any dataref attribute present in the cloudevent event/context and a bool to indicate if it was found. If not found, the DataRefExtension.DataRef value will be ""

type DistributedTracingExtension

type DistributedTracingExtension struct {
	TraceParent string `json:"traceparent"`
	TraceState  string `json:"tracestate"`
}

DistributedTracingExtension represents the extension for cloudevents context

func GetDistributedTracingExtension

func GetDistributedTracingExtension(event event.Event) (DistributedTracingExtension, bool)

func (DistributedTracingExtension) AddTracingAttributes

func (d DistributedTracingExtension) AddTracingAttributes(e event.EventWriter)

AddTracingAttributes adds the tracing attributes traceparent and tracestate to the cloudevents context

func (*DistributedTracingExtension) ReadTransformer

func (*DistributedTracingExtension) WriteTransformer

func (d *DistributedTracingExtension) WriteTransformer() binding.TransformerFunc

Jump to

Keyboard shortcuts

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