Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CodecRegistry ¶
type CodecRegistry struct {
// contains filtered or unexported fields
}
CodecRegistry maps media types to Codec implementations and injects itself into the request context. It implements plugin.ContextInjector — the framework injects it on every request automatically.
func NewCodecRegistry ¶
func NewCodecRegistry() *CodecRegistry
NewCodecRegistry creates an empty CodecRegistry.
func (*CodecRegistry) Inject ¶
func (cr *CodecRegistry) Inject(r *http.Request) *http.Request
Inject implements plugin.ContextInjector, storing the registry in the request context.
func (*CodecRegistry) Register ¶
func (cr *CodecRegistry) Register(mediaType string, c Codec)
Register adds or replaces the Codec for the given media type.
type JsonCodec ¶
type JsonCodec struct{}
JsonCodec is the built-in Codec for application/json. Auto-registered by the framework — no setup required.
type MsgpackCodec ¶
type MsgpackCodec struct{}
MsgpackCodec provides application/msgpack serialization and deserialization. It implements plugin.Installer to register itself into the CodecRegistry at startup.
router.AddPlugin(&codec.MsgpackCodec{})
func (*MsgpackCodec) Install ¶
func (c *MsgpackCodec) Install(ctx plugin.PluginContext)
type TextCodec ¶
type TextCodec struct{}
TextCodec is the built-in Codec for text/plain. Auto-registered by the framework — no setup required.
type XmlCodec ¶
type XmlCodec struct{}
XmlCodec provides application/xml serialization and deserialization. It implements plugin.Installer to register itself into the CodecRegistry at startup.
router.AddPlugin(&codec.XmlCodec{})
func (*XmlCodec) Install ¶
func (c *XmlCodec) Install(ctx plugin.PluginContext)
type YamlCodec ¶
type YamlCodec struct{}
YamlCodec provides application/yaml serialization and deserialization. It implements plugin.Installer to register itself into the CodecRegistry at startup.
router.AddPlugin(&codec.YamlCodec{})
func (*YamlCodec) Install ¶
func (c *YamlCodec) Install(ctx plugin.PluginContext)