mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 01:43:16 +01:00
63e86b72c5
In this commit, we add a new type, `RecordT[T, V]` to reduce some of the common boiler plate for TLV types. This type lets you take either a primitive type, or an existing Record, and gain common methods used to create tlv streams. It also serves as extra type annotation as well, since wire structs can use this to wrap any existing type and gain the relevant record methods. This implementation ensures that the very definition of the field also binds the TLV type value. It does this by using the generated code to map a struct like TlvType1 to an actually Type like Type(1). |
||
---|---|---|
.. | ||
internal/gen | ||
fuzz_test.go | ||
go.mod | ||
go.sum | ||
primitive_test.go | ||
primitive.go | ||
record_test.go | ||
record_type_test.go | ||
record_type.go | ||
record.go | ||
stream_test.go | ||
stream.go | ||
tlv_test.go | ||
tlv_type_param.go | ||
tlv_types_generated.go | ||
truncated_test.go | ||
truncated.go | ||
varint_test.go | ||
varint.go |