package
2.15.2
Repository: https://github.com/cloudevents/sdk-go.git
Documentation: pkg.go.dev

# Packages

Package buffering provides APIs for buffered messages.
Package format formats structured events.
Package spec provides spec-version metadata.
Package test provides utilities to test binding implementations and transformers.
Package transformer provides methods for creating event message transformers.
No description provided by the author

# Functions

DirectWrite invokes the encoders.
GetOrDefaultFromCtx gets a configuration value from the provided context.
ToEvent translates a Message with a valid Structured or Binary representation to an Event.
ToEvents translates a Batch Message and corresponding Reader data to a slice of Events.
No description provided by the author
No description provided by the author
UseFormatForEvent configures which format to use when marshalling the event to structured mode.
WithFinish returns a wrapper for m that calls finish() and m.Finish() in its Finish().
WithForceBinary forces binary encoding during the encoding process.
WithForceStructured forces structured encoding during the encoding process.
WithPreferredEventEncoding defines the preferred encoding from event to message during the encoding process.
WithSkipDirectBinaryEncoding skips direct binary to binary encoding during the encoding process.
WithSkipDirectStructuredEncoding skips direct structured to structured encoding during the encoding process.
Write executes the full algorithm to encode a Message using transformers: 1.

# Constants

EncodingBatch is an instance of JSON Batched Events.
Binary encoding as specified in https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#message.
Message is an instance of EventMessage or it contains EventMessage nested (through MessageWrapper).
Structured encoding as specified in https://github.com/cloudevents/spec/blob/main/cloudevents/spec.md#message.
When the encoding is unknown (which means that the message is a non-event).

# Variables

ErrCannotConvertToEvent is a generic error when a conversion of a Message to an Event fails.
ErrCannotConvertToEvents is a generic error when a conversion of a Message to a Batched Event fails.
ErrNotBinary returned by Message.Binary for non-binary messages.
ErrNotStructured returned by Message.Structured for non-structured messages.
ErrUnknownEncoding specifies that the Message is not an event or it is encoded with an unknown encoding.

# Interfaces

BinaryWriter is used to visit a binary Message and generate a new representation.
ExactlyOnceMessage is implemented by received Messages that support QoS 2.
Message is the interface to a binding-specific message containing an event.
MessageContext interface exposes the internal context that a message might contain Only some Message implementations implement this interface.
MessageMetadataReader defines how to read metadata from a binary/event message If a message implementing MessageReader is encoded as binary (MessageReader.ReadEncoding() == EncodingBinary) or it's an EventMessage, then it's safe to assume that it also implements this interface.
MessageMetadataWriter is used to set metadata when a binary Message is visited.
MessageReader defines the read-related portion of the Message interface.
MessageWrapper interface is used to walk through a decorated Message and unwrap it.
StructuredWriter is used to visit a structured Message and generate a new representation.
Transformer is an interface that implements a transformation process while transferring the event from the Message implementation to the provided encoder When a write function (binding.Write, binding.ToEvent, buffering.CopyMessage, etc.) takes Transformer(s) as parameter, it eventually converts the message to a form which correctly implements MessageMetadataReader, in order to guarantee that transformation is applied.

# Type aliases

Encoding enum specifies the type of encodings supported by binding interfaces.
EventMessage type-converts a event.Event object to implement Message.
TransformerFunc is a type alias to implement a Transformer through a function pointer.
Transformers is a utility alias to run several Transformer.