-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
recordio: refactor frame parsing, bug fixes, better unit testing
- Loading branch information
James DeFelice
committed
Jun 18, 2017
1 parent
5d21284
commit 75921d5
Showing
6 changed files
with
342 additions
and
134 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
package framing | ||
|
||
type Error string | ||
|
||
func (err Error) Error() string { return string(err) } | ||
|
||
const ( | ||
ErrorUnderrun = Error("frame underrun, unexpected EOF") | ||
ErrorBadSize = Error("bad frame size") | ||
ErrorOversizedFrame = Error("oversized frame, max size exceeded") | ||
) | ||
|
||
type Reader interface { | ||
ReadFrame(buf []byte) (endOfFrame bool, n int, err error) | ||
ReadFrame() (frame []byte, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.