Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ExtensionDataTransfer1_1 is the identifier for the current data transfer extension to graphsync ExtensionDataTransfer1_1 = graphsync.ExtensionName("fil/data-transfer/1.1") // ExtensionDataTransfer1_0 is the identifier for the legacy data transfer extension to graphsync ExtensionDataTransfer1_0 = graphsync.ExtensionName("fil/data-transfer") )
Variables ¶
View Source
var ProtocolMap = map[graphsync.ExtensionName]protocol.ID{ ExtensionDataTransfer1_1: datatransfer.ProtocolDataTransfer1_1, ExtensionDataTransfer1_0: datatransfer.ProtocolDataTransfer1_0, }
ProtocolMap maps graphsync extensions to their libp2p protocols
Functions ¶
func GetTransferData ¶
func GetTransferData(extendedData GsExtended) (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 getExtensionData
Click to show internal directories.
Click to hide internal directories.