records/mpp: add MPP struct to create corresponding tlv.Record

Used to encode/decode MPP tlv records
This commit is contained in:
Conner Fromknecht
2019-11-04 14:11:02 -08:00
parent b3b51923dc
commit b1b7ff8006
3 changed files with 179 additions and 0 deletions

View File

@@ -43,6 +43,14 @@ func SizeVarBytes(e *[]byte) SizeFunc {
}
}
// RecorderProducer is an interface for objects that can produce a Record object
// capable of encoding and/or decoding the RecordProducer as a Record.
type RecordProducer interface {
// Record returns a Record that can be used to encode or decode the
// backing object.
Record() Record
}
// Record holds the required information to encode or decode a TLV record.
type Record struct {
value interface{}