Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ExtensionIncomingRequest1_1 is the identifier for data sent by the IncomingRequest hook ExtensionIncomingRequest1_1 = graphsync.ExtensionName("fil/data-transfer/incoming-request/1.1") // ExtensionOutgoingBlock1_1 is the identifier for data sent by the OutgoingBlock hook ExtensionOutgoingBlock1_1 = graphsync.ExtensionName("fil/data-transfer/outgoing-block/1.1") // ExtensionDataTransfer1_1 is the identifier for the v1.1 data transfer extension to graphsync ExtensionDataTransfer1_1 = graphsync.ExtensionName("fil/data-transfer/1.1") )
Variables ¶
View Source
var ProtocolMap = map[graphsync.ExtensionName]protocol.ID{ ExtensionIncomingRequest1_1: datatransfer.ProtocolDataTransfer1_2, ExtensionOutgoingBlock1_1: datatransfer.ProtocolDataTransfer1_2, ExtensionDataTransfer1_1: datatransfer.ProtocolDataTransfer1_2, }
ProtocolMap maps graphsync extensions to their libp2p protocols
Functions ¶
func GetTransferData ¶
func GetTransferData(extendedData GsExtended, extNames []graphsync.ExtensionName) (datatransfer.Message, error)
GetTransferData unmarshals extension data. Returns:
- nil + nil if the extension is not found
- nil + error if the extendedData fails to unmarshal
- unmarshaled ExtensionDataTransferData + nil if all goes well
func ToExtensionData ¶
func ToExtensionData(msg datatransfer.Message, supportedExtensions []graphsync.ExtensionName) ([]graphsync.ExtensionData, error)
ToExtensionData converts a message to a graphsync extension
Types ¶
type GsExtended ¶
GsExtended is a small interface used by GetTransferData
Click to show internal directories.
Click to hide internal directories.