protojsonserializer

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

ProviderSet provides a protojsonserializer and binds it to protosource.Serializer.

Functions

func MarshalEvent

func MarshalEvent(event protosource.Event) ([]byte, error)

MarshalEvent wraps the event in an anypb.Any and serializes to JSON. The resulting bytes are human-readable JSON containing the fully-qualified type URL and the event fields.

func UnmarshalEvent

func UnmarshalEvent(data []byte) (protosource.Event, error)

UnmarshalEvent deserializes JSON bytes back into an Event. The JSON must contain an anypb.Any envelope with a @type field identifying the concrete event type.

Types

type Serializer

type Serializer struct{}

func NewSerializer

func NewSerializer() *Serializer

func (*Serializer) MarshalEvent

func (s *Serializer) MarshalEvent(event protosource.Event) (*recordv1.Record, error)

func (*Serializer) MarshalEventAsData

func (s *Serializer) MarshalEventAsData(event protosource.Event) ([]byte, error)

func (*Serializer) UnmarshalEvent

func (s *Serializer) UnmarshalEvent(record *recordv1.Record) (protosource.Event, error)

func (*Serializer) UnmarshalEventFromData

func (s *Serializer) UnmarshalEventFromData(data []byte) (protosource.Event, error)

Jump to

Keyboard shortcuts

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