Documentation
¶
Overview ¶
Package messaging holds broker-agnostic primitives shared by every messaging transport in the kit (AMQP, NATS, and future brokers). The goal is that a service's handler / encoder / decoder code reads the same regardless of which broker delivers the message, so the broker can be swapped at the wire layer without touching the application layer.
The transport packages re-export these types under their own names (e.g. amqp.Handler is messaging.Handler) so existing code keeps working; new code should import this package directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONDecoder ¶
JSONDecoder is a ready-made Decoder for JSON payloads. Mirror of JSONEncoder for the consumer side.
Types ¶
type Decoder ¶
Decoder is the inverse of Encoder: given a payload (and any broker metadata the transport extracted into ctx) it returns the decoded value or an error.
type Encoder ¶
Encoder turns an application value into the byte payload that goes on the wire. Returns an error if the value cannot be marshalled.