Documentation ¶
Overview ¶
Package format formats structured events.
The "application/cloudevents+json" format is built-in and always available. Other formats may be added.
Index ¶
Constants ¶
View Source
const Prefix = "application/cloudevents"
Prefix for event-format media types.
Variables ¶
View Source
var JSON = jsonFmt{}
JSON is the built-in "application/cloudevents+json" format.
Functions ¶
Types ¶
type Format ¶
type Format interface { // MediaType identifies the format MediaType() string // Marshal event to bytes Marshal(ce.Event) ([]byte, error) // Unmarshal bytes to event Unmarshal([]byte, *ce.Event) error }
Format marshals and unmarshals structured events to bytes.
type UnknownFormat ¶ added in v1.0.0
type UnknownFormat string
UnknownFormat allows an event with an unknown format string to be forwarded, but Marshal() and Unmarshal will always fail.
func (UnknownFormat) Marshal ¶ added in v1.0.0
func (uf UnknownFormat) Marshal(ce.Event) ([]byte, error)
func (UnknownFormat) MediaType ¶ added in v1.0.0
func (uf UnknownFormat) MediaType() string
Click to show internal directories.
Click to hide internal directories.