bminer / schemer

Lightweight and flexible data encoding and decoding library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Replace `DecodeSchema` and `DecodeSchemaJSON` with custom Decoder

bminer opened this issue · comments

Replace DecodeSchema and DecodeSchemaJSON with something like NewSchemaDecoder and NewJSONSchemaDecoder.

I'd like to mirror the JSON decoder API to provide a Buffered() method that returns an io.Reader.

  • func (Decoder) Buffered() bufio.Reader
  • func (Decoder) Decode() (Schema, error)

This makes it clearer that the io.Reader is a buffered reader, and it exposes the buffered but unconsumed contents of the Reader.