Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeData(ctx context.Context, in []byte, out interface{}) error
- func EncodeData(ctx context.Context, in interface{}) ([]byte, error)
- func FromProto(container *pb.CloudEvent) (*event.Event, error)
- func StringOfApplicationCloudEventsProtobuf() *string
- func ToProto(e *event.Event) (*pb.CloudEvent, error)
Constants ¶
View Source
const (
ApplicationCloudEventsProtobuf = "application/cloudevents+protobuf"
)
View Source
const ( // ContentTypeProtobuf indicates that the data attribute is a protobuf // message. ContentTypeProtobuf = "application/protobuf" )
Variables ¶
View Source
var (
// Protobuf is the built-in "application/cloudevents+protobuf" format.
Protobuf = protobufFmt{}
)
Functions ¶
func DecodeData ¶
DecodeData converts an encoded protobuf message back into the message (out). The message must be a type compatible with whatever was given to EncodeData.
func EncodeData ¶
EncodeData a protobuf message to bytes.
Like the official datacodec implementations, this one returns the given value as-is if it is already a byte slice.
func FromProto ¶ added in v2.9.0
func FromProto(container *pb.CloudEvent) (*event.Event, error)
Convert from a protobuf variant into the generic, SDK event.
func StringOfApplicationCloudEventsProtobuf ¶
func StringOfApplicationCloudEventsProtobuf() *string
StringOfApplicationCloudEventsProtobuf returns a string pointer to "application/cloudevents+protobuf"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.