Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (19 sloc) 446 Bytes
package lion
import "io"
type readPuller struct {
reader io.Reader
unmarshaller Unmarshaller
}
func newReadPuller(reader io.Reader, unmarshaller Unmarshaller) *readPuller {
return &readPuller{
reader,
unmarshaller,
}
}
func (r *readPuller) Pull() (*EncodedEntry, error) {
encodedEntry := &EncodedEntry{}
if err := r.unmarshaller.Unmarshal(r.reader, encodedEntry); err != nil {
return nil, err
}
return encodedEntry, nil
}