graphsync

package
v1.15.3 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2023 License: Apache-2.0, MIT Imports: 14 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelGraphsyncRequests added in v1.11.7

type ChannelGraphsyncRequests struct {
	// Current is the current request ID for the transfer
	Current graphsync.RequestID
	// Previous are ids of previous GraphSync requests in a transfer that
	// has been restarted. We may be interested to know if these IDs are active
	// on either side of the request
	Previous []graphsync.RequestID
}

ChannelGraphsyncRequests describes any graphsync request IDs associated with a given channel

type ChannelsForPeer added in v1.11.7

type ChannelsForPeer struct {
	SendingChannels   map[datatransfer.ChannelID]ChannelGraphsyncRequests
	ReceivingChannels map[datatransfer.ChannelID]ChannelGraphsyncRequests
}

ChannelsForPeer describes current active channels for a given peer and their associated graphsync requests

type Option added in v0.9.0

type Option func(*Transport)

Option is an option for setting up the graphsync transport

func RegisterCompletedRequestListener added in v1.2.9

func RegisterCompletedRequestListener(l func(channelID datatransfer.ChannelID)) Option

RegisterCompletedRequestListener is used by the tests

func RegisterCompletedResponseListener added in v1.2.9

func RegisterCompletedResponseListener(l func(channelID datatransfer.ChannelID)) Option

RegisterCompletedResponseListener is used by the tests

func SupportedExtensions added in v0.9.0

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) ChannelsForPeer added in v1.11.7

func (t *Transport) ChannelsForPeer(p peer.ID) ChannelsForPeer

ChannelsForPeer identifies which channels are open and which request IDs they map to

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 data-transfer channel

func (*Transport) OpenChannel

func (t *Transport) OpenChannel(
	ctx context.Context,
	dataSender peer.ID,
	channelID datatransfer.ChannelID,
	root ipld.Link,
	stor ipld.Node,
	channel datatransfer.ChannelState,
	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 pauses the given data-transfer channel

func (*Transport) ResumeChannel

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

ResumeChannel resumes the given data-transfer channel and sends the message if there is one

func (*Transport) SetEventHandler

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

SetEventHandler sets the handler for events on channels

func (*Transport) Shutdown added in v1.0.1

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

Shutdown disconnects a transport interface from graphsync

func (*Transport) UseStore added in v0.5.1

func (t *Transport) UseStore(channelID datatransfer.ChannelID, lsys ipld.LinkSystem) 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