Versions in this module Expand all Collapse all v0 v0.0.2 Nov 30, 2019 v0.0.1 Oct 20, 2019 Changes in this version + var NotRegistered = errors.New("Media type is not registered") + func Decode(ctx context.Context, r io.Reader, mimed string, thing interface{}) error + func Encode(w io.Writer, mimed string, thing interface{}) error + func HasDecoder(mimed string) bool + func HasEncoder(mimed string) bool + func Register(mimed string, e EncoderFunc, d DecoderFunc) + type Decoder interface + Decode func(context.Context, interface{}) error + func NewDecoder(mimed string, r io.Reader) (Decoder, error) + type DecoderFunc func(io.Reader) (Decoder, error) + type Encoder interface + Encode func(interface{}) error + func NewEncoder(mimed string, w io.Writer) (Encoder, error) + type EncoderFunc func(io.Writer) (Encoder, error) + type Registry struct + func (a *Registry) HasDecoder(mimed string) bool + func (a *Registry) HasEncoder(mimed string) bool + func (a *Registry) NewDecoder(mimed string, r io.Reader) (Decoder, error) + func (a *Registry) NewEncoder(mimed string, w io.Writer) (Encoder, error) + func (a *Registry) Register(mimed string, r *registration)