extension

package
v2.0.0-rc6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 13, 2023 License: Apache-2.0, MIT Imports: 6 Imported by: 0

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

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

type GsExtended interface {
	Extension(name graphsync.ExtensionName) (datamodel.Node, bool)
}

GsExtended is a small interface used by GetTransferData

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL