graphsync

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: 12 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Transport)

Option is an option for setting up the graphsync transport

func SupportedExtensions

func SupportedExtensions(supportedExtensions []graphsync.ExtensionName) Option

SupportedExtensions sets what data transfer extensions are supported

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

Transport manages graphsync hooks for data transfer, translating from graphsync hooks to semantic data transfer events

func NewTransport

func NewTransport(peerID peer.ID, gs graphsync.GraphExchange, options ...Option) *Transport

NewTransport makes a new hooks manager with the given hook events interface

func (*Transport) CleanupChannel

func (t *Transport) CleanupChannel(chid datatransfer.ChannelID)

CleanupChannel is called on the otherside of a cancel - removes any associated data for the channel

func (*Transport) CloseChannel

func (t *Transport) CloseChannel(ctx context.Context, chid datatransfer.ChannelID) error

CloseChannel closes the given channel

func (*Transport) OpenChannel

func (t *Transport) OpenChannel(ctx context.Context,
	dataSender peer.ID,
	channelID datatransfer.ChannelID,
	root ipld.Link,
	stor ipld.Node,
	doNotSendCids []cid.Cid,
	msg datatransfer.Message) error

OpenChannel initiates an outgoing request for the other peer to send data to us on this channel Note: from a data transfer symantic standpoint, it doesn't matter if the request is push or pull -- OpenChannel is called by the party that is intending to receive data

func (*Transport) PauseChannel

func (t *Transport) PauseChannel(ctx context.Context,
	chid datatransfer.ChannelID,
) error

PauseChannel paused the given channel ID

func (*Transport) ResumeChannel

func (t *Transport) ResumeChannel(ctx context.Context,
	msg datatransfer.Message,
	chid datatransfer.ChannelID,
) error

ResumeChannel resumes the given channel

func (*Transport) SetEventHandler

func (t *Transport) SetEventHandler(events datatransfer.EventsHandler) error

SetEventHandler sets the handler for events on channels

func (*Transport) Shutdown

func (t *Transport) Shutdown(ctx context.Context) error

Shutdown disconnects a transport interface from graphsync

func (*Transport) UseStore

func (t *Transport) UseStore(channelID datatransfer.ChannelID, loader ipld.Loader, storer ipld.Storer) error

UseStore tells the graphsync transport to use the given loader and storer for this channelID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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