extension

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2020 License: Apache-2.0, MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const (
	// ExtensionDataTransfer is the identifier for the data transfer extension to graphsync
	ExtensionDataTransfer = graphsync.ExtensionName("fil/data-transfer")
)

Variables

This section is empty.

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) (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