proto

package module
v0.0.0-...-e3b6445 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base64Formatter

type Base64Formatter struct{}

Base64Formatter implements formatter interface for both protobuf v1 and v2 messages. Intended for use with SQS

func NewBase64Formatter

func NewBase64Formatter() Base64Formatter

func (*Base64Formatter) Marshall

func (p *Base64Formatter) Marshall(v any) ([]byte, error)

Marshall as proto and then base64 encode (useful for technologies like SQS which limit the character set)

func (*Base64Formatter) Unmarshal

func (p *Base64Formatter) Unmarshal(b []byte, v any) error

Unmarshal with base64 decoding

type JSONFormatter

type JSONFormatter struct{}

JSONFormatter encodes/decodes proto go struct to json format

func NewJSONFormatter

func NewJSONFormatter() JSONFormatter

func (*JSONFormatter) Marshall

func (j *JSONFormatter) Marshall(v any) ([]byte, error)

func (*JSONFormatter) Unmarshal

func (j *JSONFormatter) Unmarshal(b []byte, v any) error

type RawFormatter

type RawFormatter struct{}

RawFormatter implements formatter interface for both protobuf v1 and v2 messages. Does not base64 encode.

func NewRawFormatter

func NewRawFormatter() RawFormatter

func (*RawFormatter) Marshall

func (p *RawFormatter) Marshall(v any) ([]byte, error)

Marshall encodes the data as a proto binary

func (*RawFormatter) Unmarshal

func (p *RawFormatter) Unmarshal(b []byte, v any) error

Unmarshal accepts proto binary and hydrates a proto generated struct

type SchematizedBase64FormatterDeprecated

type SchematizedBase64FormatterDeprecated struct {
	SchemaID int
	// contains filtered or unexported fields
}

SchematizedBase64FormatterDeprecated follows the Confluent Wire Format https://docs.confluent.io/current/schema-registry/serdes-develop/index.html#wire-format

func (*SchematizedBase64FormatterDeprecated) Marshall

func (p *SchematizedBase64FormatterDeprecated) Marshall(v any) ([]byte, error)

Marshall converts input into avro binary data with schema ID attached

func (*SchematizedBase64FormatterDeprecated) Unmarshal

func (p *SchematizedBase64FormatterDeprecated) Unmarshal(b []byte, v any) error

Unmarshal fills avro binary data into provided interface v and validates the schema ID

Jump to

Keyboard shortcuts

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