dtutils

package
v0.0.0-...-75360cb Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Overview

Package dtutils provides event listeners for the client and provider to listen for events on the data transfer module and dispatch FSM events based on them

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientDataTransferSubscriber

func ClientDataTransferSubscriber(deals EventReceiver) datatransfer.Subscriber

ClientDataTransferSubscriber is the function called when an event occurs in a data transfer initiated on the client -- it reads the voucher to verify this even occurred in a retrieval market deal, then, based on the data transfer event that occurred, it dispatches an event to the appropriate state machine

func ProviderDataTransferSubscriber

func ProviderDataTransferSubscriber(deals EventReceiver) datatransfer.Subscriber

ProviderDataTransferSubscriber is the function called when an event occurs in a data transfer received by a provider -- it reads the voucher to verify this event occurred in a storage market deal, then, based on the data transfer event that occurred, it generates and update message for the deal -- either moving to staged for a completion event or moving to error if a data transfer error occurs

func TransportConfigurer

func TransportConfigurer(thisPeer peer.ID, storeGetter StoreGetter) datatransfer.TransportConfigurer

TransportConfigurer configurers the graphsync transport to use a custom blockstore per deal

Types

type EventReceiver

type EventReceiver interface {
	Send(id interface{}, name fsm.EventName, args ...interface{}) (err error)
}

EventReceiver is any thing that can receive FSM events

type StoreConfigurableTransport

type StoreConfigurableTransport interface {
	UseStore(datatransfer.ChannelID, ipld.LinkSystem) error
}

StoreConfigurableTransport defines the methods needed to configure a data transfer transport use a unique store for a given request

type StoreGetter

type StoreGetter interface {
	Get(otherPeer peer.ID, dealID rm.DealID) (bstore.Blockstore, error)
}

StoreGetter retrieves the store for a given id

Jump to

Keyboard shortcuts

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