Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeBlock ¶
func DecodeBlock[T any, B ~string]( data []byte, expected B, blockType func(T) B, normalize func(*T, B), ) (T, error)
DecodeBlock unmarshals one typed content-block payload and enforces its expected type.
func MarshalEnvelopeJSON ¶
func MarshalEnvelopeJSON[T ~string](blockType T, data json.RawMessage) ([]byte, error)
MarshalEnvelopeJSON preserves the canonical JSON payload stored in an envelope.
func ValidatePayload ¶
ValidatePayload rejects nil payloads before they reach encoding/json.
Types ¶
type Envelope ¶
type Envelope[T ~string] struct { Type T Data json.RawMessage }
Envelope stores one typed content-block payload in canonical JSON form.
func MarshalEnvelope ¶
MarshalEnvelope encodes one typed block and returns its canonical envelope data.
Click to show internal directories.
Click to hide internal directories.