tlv: add new Blob type alias

In this commit, we add a new type alias for a blob type. This type can be used in areas where a byte slice is used to store a TLV value, which may be a fully opaque nested TLV.
This commit is contained in:
Olaoluwa Osuntokun authored and Oliver Gugger committed 2024-04-25 16:48:06 +02:00
1 parent 2089a88f4b
commit 5b2869b0ec
3 files changed
+22 -25

No files matched your search

+4
View File
@@ -17,6 +17,10 @@ type Type uint64
// slice containing the encoded data.
type TypeMap map[Type][]byte
// Blob is a type alias for a byte slice. It's used to indicate that a slice of
// bytes is actually an encoded TLV stream.
type Blob = []byte
// Encoder is a signature for methods that can encode TLV values. An error
// should be returned if the Encoder cannot support the underlying type of val.
// The provided scratch buffer must be non-nil.