Documentation ¶
Overview ¶
Package datacodec holds the data codec registry and adds known encoders and decoders supporting media types such as `application/json` and `application/xml`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // LatencyMs measures the latency in milliseconds for the CloudEvents generic // codec data methods. LatencyMs = stats.Float64("cloudevents.io/sdk-go/datacodec/latency", "The latency in milliseconds for the CloudEvents generic data codec methods.", "ms") )
View Source
var ( // LatencyView is an OpenCensus view that shows data codec method latency. LatencyView = &view.View{ Name: "datacodec/latency", Measure: LatencyMs, Description: "The distribution of latency inside of the generic data codec for CloudEvents.", Aggregation: view.Distribution(0, .01, .1, 1, 10, 100, 1000, 10000), TagKeys: observability.LatencyTags(), } )
Functions ¶
func AddDecoder ¶
AddDecoder registers a decoder for a given content type. The codecs will use these to decode the data payload from a cloudevent.Event object.
func AddEncoder ¶
AddEncoder registers an encoder for a given content type. The codecs will use these to encode the data payload for a cloudevent.Event object.
Types ¶
Directories ¶
Path | Synopsis |
---|---|
Package json holds the encoder/decoder implementation for `application/json`.
|
Package json holds the encoder/decoder implementation for `application/json`. |
Text codec converts []byte or string to string and vice-versa.
|
Text codec converts []byte or string to string and vice-versa. |
Package xml holds the encoder/decoder implementation for `application/xml`.
|
Package xml holds the encoder/decoder implementation for `application/xml`. |
Click to show internal directories.
Click to hide internal directories.