transformer

package
v2.0.0 Latest Latest
Warning

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

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

Documentation

Overview

Package transformer provides methods for creating event message transformers.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Add the cloudevents time attribute, if missing, to time.Now()
	AddTimeNow binding.Transformer = addTimeNow{}
)

Functions

func AddAttribute

func AddAttribute(attributeKind spec.Kind, value interface{}) binding.TransformerFunc

AddAttribute adds a cloudevents attribute (if missing) during the encoding process

func AddExtension

func AddExtension(name string, value interface{}) binding.TransformerFunc

AddExtension adds a cloudevents extension (if missing) during the encoding process

func DeleteAttribute

func DeleteAttribute(attributeKind spec.Kind) binding.TransformerFunc

DeleteAttribute deletes a cloudevents attribute during the encoding process

func DeleteExtension

func DeleteExtension(name string) binding.TransformerFunc

DeleteExtension deletes a cloudevents extension during the encoding process

func SetAttribute

func SetAttribute(attribute spec.Kind, updater func(interface{}) (interface{}, error)) binding.TransformerFunc

SetAttribute sets a cloudevents attribute using the provided function. updater gets a zero value as input if no previous value was found. To test a zero value, use types.IsZero(). updater must return nil, nil if the user wants to remove the attribute

func SetExtension

func SetExtension(name string, updater func(interface{}) (interface{}, error)) binding.TransformerFunc

SetExtension sets a cloudevents extension using the provided function. updater gets a zero value as input if no previous value was found. To test a zero value, use types.IsZero() updater must return nil, nil if the user wants to remove the extension

func Version

func Version(newVersion spec.Version) binding.TransformerFunc

Version converts the event context version to the specified one.

Types

This section is empty.

Jump to

Keyboard shortcuts

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