parser: generalize API for decoding serializable types

This commit is contained in:
George Tankersley
2018-09-14 00:00:00 +00:00
parent c947b00d36
commit 35638b3900
4 changed files with 202 additions and 18 deletions

12
parser/serializable.go Normal file
View File

@@ -0,0 +1,12 @@
package parser
import "encoding"
type Serializable interface {
encoding.BinaryMarshaler
encoding.BinaryUnmarshaler
}
type Decoder interface {
Decode(v Serializable) error
}