serialization

package
v3.16.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMessageTypeNotAllowed       = errors.New("message type not allowed") // for topics that have lots of types we don't care about
	ErrSerializationFailure        = errors.New("serialization failure")
	ErrUnknownContentType          = errors.New("the content type provided was not understood")
	ErrMessageTypeNotFound         = errors.New("the message type provided was not understood")
	ErrDeserializeMalformedPayload = errors.New("the payload provided was not understood by the deserializer")
	ErrSerializeUnsupportedType    = errors.New("the type provided cannot be serialized")
)
View Source
var Options singleton

Functions

func New

func New(connector messaging.Connector, options ...option) messaging.Connector

Types

type DeliveryDecoder

type DeliveryDecoder interface {
	Decode(*messaging.Delivery) error
}

type Deserializer

type Deserializer interface {
	ContentType() string
	Deserialize(source []byte, instance any) error
}

type DispatchEncoder

type DispatchEncoder interface {
	Encode(*messaging.Dispatch) error
}

type Serializer

type Serializer interface {
	ContentType() string
	Serialize(instance any) ([]byte, error)
}

Jump to

Keyboard shortcuts

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