Documentation ¶
Overview ¶
in a seperate package because this is used by beacon/locations and beacon/root this should probably be moved to internal if moneysocket (socket) is ever moved to its own package
Index ¶
Constants ¶
const ( // types cannot be less than 2^16 according to bolt-1 https://git.io/JLCRq TlvMinimum = 65536 // starting value is 2^16+443 and will increment by 2 for new types https://git.io/JLCRc TlvTypeStart = TlvMinimum + 443 // tlv type for a beacon BeaconTlvType tlv.Type = TlvTypeStart SharedSeedTlvType tlv.Type = TlvTypeStart + 2 // tlv type for a location count LocationCountTlvType tlv.Type = TlvTypeStart + 4 // tlv type for a list LocationListTlvType tlv.Type = TlvTypeStart + 6 // location websockets WebsocketLocationTlvType tlv.Type = TlvTypeStart + 8 // TODO beacons/__init.py https://git.io/JLC0J WebrtcLocationTlvType = TlvTypeStart + 10 // TODO beacons/__init__.py https://git.io/JLC0I BluetoothLocationTlvType tlv.Type = TlvTypeStart + 12 // TODO beacons/__init__.py https://git.io/JLC0g NfcLocationTlvType tlv.Type = TlvTypeStart + 14 )
Variables ¶
var TlvTypes = []tlv.Type{BeaconTlvType, SharedSeedTlvType, LocationCountTlvType, LocationListTlvType, WebsocketLocationTlvType, WebrtcLocationTlvType, BluetoothLocationTlvType, NfcLocationTlvType}
list of all custom implemented tlv types in the package
Functions ¶
func DVarInt ¶
DVarBytes is a Decoder for variable byte slices. An error is returned if val is not *[]byte.
func EVarInt ¶
EVarInt is an Encoder for variable byte slices. An error is returned if val is not *[]byte.
func NamespaceTlvsAreValid ¶
assert tlvs are valid
Types ¶
type Tlv ¶
type Tlv struct {
// contains filtered or unexported fields
}
For encoding/decoding values to/from Tlv (Type-Length-Value) byte strings as defined in: https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#type-length-value-format note: I tried to use the golang implementation, but didn't quite get the sreaming encodes/decodes to work. this can be fixed in a future version
func NamespaceIterTlvs ¶
func NamespacePopTlvs ¶
Represents a specific namespace of TLVs as referred to in BOLT 1 and provides generic pop helpers for the fundamental types defined here: https://github.com/lightningnetwork/lightning-rfc/blob/master/01-messaging.md#fundamental-types see: https://github.com/moneysocket/py-moneysocket/blob/main/moneysocket/utl/third_party/bolt/namespace.py#L9