graphsync

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: 9 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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) *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,
	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) UseStore added in v0.5.1

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