extension

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2021 License: Apache-2.0, MIT Imports: 8 Imported by: 0

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

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

type GsExtended interface {
	Extension(name graphsync.ExtensionName) ([]byte, bool)
}

GsExtended is a small interface used by getExtensionData

Jump to

Keyboard shortcuts

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