dolanor / rip

REST in peace
BSD 3-Clause "New" or "Revised" License
68 stars 0 forks source link

encoding: move Wrap* funcs to a codecutil package #10

Closed dolmen closed 5 months ago

dolmen commented 5 months ago

About the encoding API, the WrapCodec, WrapDecoder and WrapEncoder are utility funcs which are only useful to implementers of Codecs: they are implementation details that are not useful to users of the encoding package.

So I propose to move them to their own package github.com/dolanor/rip/encoding/codecutil. That will make the API of encoding package lighter and easier to learn.

dolmen commented 5 months ago

Types NewEncoderFunc and NewDecoderFunc could be moved as well to the util package (and replaced by the anonymous func types in the Codec type).

dolanor commented 5 months ago

Good point.

Thanks for all those detail. They will really improve the public API which is something I care about, but I was to entrenched in my hacking mindset of the time.