impl

package
v0.0.0-...-05a1ede Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(parent context.Context, network gsnet.GraphSyncNetwork,
	linkSystem ipld.LinkSystem, options ...graphsyncImpl.Option) pargraphsync.ParallelGraphExchange

New creates a new GraphSync Exchange on the given network, and the given link loader+storer.

Types

type ParallelGraphSync

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

ParallelGraphSync is an instance of a ParallelGraphSync exchange that implements the graphsync protocol.

func (*ParallelGraphSync) Cancel

func (gs *ParallelGraphSync) Cancel(ctx context.Context, groupRequestID graphsync.RequestID) error

Cancel cancels an in progress request or response

func (*ParallelGraphSync) CancelSubRequest

func (gs *ParallelGraphSync) CancelSubRequest(ctx context.Context, subRequestID graphsync.RequestID) error

CancelSubRequest cancels an in progress sub request or response

func (*ParallelGraphSync) GetGroupRequestBySubRequestId

func (gs *ParallelGraphSync) GetGroupRequestBySubRequestId(subRequestID graphsync.RequestID) pargraphsync.GroupRequest

func (*ParallelGraphSync) Pause

func (gs *ParallelGraphSync) Pause(ctx context.Context, groupRequestID graphsync.RequestID) error

Pause pauses an in progress request or response

func (*ParallelGraphSync) RegisterBlockSentListener

func (gs *ParallelGraphSync) RegisterBlockSentListener(listener graphsync.OnBlockSentListener) graphsync.UnregisterHookFunc

RegisterBlockSentListener adds a listener for when blocks are actually sent over the wire

func (*ParallelGraphSync) RegisterCompletedResponseListener

func (gs *ParallelGraphSync) RegisterCompletedResponseListener(listener graphsync.OnResponseCompletedListener) graphsync.UnregisterHookFunc

RegisterCompletedResponseListener adds a listener on the responder for completed responses

func (*ParallelGraphSync) RegisterIncomingBlockHook

func (gs *ParallelGraphSync) RegisterIncomingBlockHook(hook graphsync.OnIncomingBlockHook) graphsync.UnregisterHookFunc

RegisterIncomingBlockHook adds a hook that runs when a block is received and validated (put in block store)

func (*ParallelGraphSync) RegisterIncomingRequestHook

func (gs *ParallelGraphSync) RegisterIncomingRequestHook(hook graphsync.OnIncomingRequestHook) graphsync.UnregisterHookFunc

RegisterIncomingRequestHook adds a hook that runs when a request is received If overrideDefaultValidation is set to true, then if the hook does not error, it is considered to have "validated" the request -- and that validation supersedes the normal validation of requests Graphsync does (i.e. all selectors can be accepted)

func (*ParallelGraphSync) RegisterIncomingRequestProcessingListener

func (gs *ParallelGraphSync) RegisterIncomingRequestProcessingListener(listener graphsync.OnRequestProcessingListener) graphsync.UnregisterHookFunc

RegisterOutgoingRequestProcessingListener adds a listener that gets called when an incoming request actually begins processing (reaches the top of the outgoing request queue)

func (*ParallelGraphSync) RegisterIncomingResponseHook

func (gs *ParallelGraphSync) RegisterIncomingResponseHook(hook graphsync.OnIncomingResponseHook) graphsync.UnregisterHookFunc

RegisterIncomingResponseHook adds a hook that runs when a response is received

func (*ParallelGraphSync) RegisterNetworkErrorListener

func (gs *ParallelGraphSync) RegisterNetworkErrorListener(listener graphsync.OnNetworkErrorListener) graphsync.UnregisterHookFunc

RegisterNetworkErrorListener adds a listener for when errors occur sending data over the wire

func (*ParallelGraphSync) RegisterOutgoingBlockHook

func (gs *ParallelGraphSync) RegisterOutgoingBlockHook(hook graphsync.OnOutgoingBlockHook) graphsync.UnregisterHookFunc

RegisterOutgoingBlockHook registers a hook that runs after each block is sent in a response

func (*ParallelGraphSync) RegisterOutgoingRequestHook

func (gs *ParallelGraphSync) RegisterOutgoingRequestHook(hook graphsync.OnOutgoingRequestHook) graphsync.UnregisterHookFunc

RegisterOutgoingRequestHook adds a hook that runs immediately prior to sending a new request

func (*ParallelGraphSync) RegisterOutgoingRequestProcessingListener

func (gs *ParallelGraphSync) RegisterOutgoingRequestProcessingListener(listener graphsync.OnRequestProcessingListener) graphsync.UnregisterHookFunc

RegisterOutgoingRequestProcessingListener adds a listener that gets called when an outgoing request actually begins processing (reaches the top of the outgoing request queue)

func (*ParallelGraphSync) RegisterPersistenceOption

func (gs *ParallelGraphSync) RegisterPersistenceOption(name string, lsys ipld.LinkSystem) error

RegisterPersistenceOption registers an alternate loader/storer combo that can be substituted for the default

func (*ParallelGraphSync) RegisterReceiverNetworkErrorListener

func (gs *ParallelGraphSync) RegisterReceiverNetworkErrorListener(listener graphsync.OnReceiverNetworkErrorListener) graphsync.UnregisterHookFunc

RegisterReceiverNetworkErrorListener adds a listener for when errors occur receiving data over the wire

func (*ParallelGraphSync) RegisterRequestUpdatedHook

func (gs *ParallelGraphSync) RegisterRequestUpdatedHook(hook graphsync.OnRequestUpdatedHook) graphsync.UnregisterHookFunc

RegisterRequestUpdatedHook registers a hook that runs when an update to a request is received

func (*ParallelGraphSync) RegisterRequestorCancelledListener

func (gs *ParallelGraphSync) RegisterRequestorCancelledListener(listener graphsync.OnRequestorCancelledListener) graphsync.UnregisterHookFunc

RegisterRequestorCancelledListener adds a listener on the responder for responses cancelled by the requestor

func (*ParallelGraphSync) Request

func (gs *ParallelGraphSync) Request(ctx context.Context, p peer.ID, root ipld.Link, selector ipld.Node, extensions ...graphsync.ExtensionData) (<-chan graphsync.ResponseProgress, <-chan error)

Request initiates a new GraphSync request to the given peer using the given selector spec.

func (*ParallelGraphSync) RequestMany

func (gs *ParallelGraphSync) RequestMany(ctx context.Context, peers []peer.ID, root ipld.Link, selector ipld.Node, extensions ...graphsync.ExtensionData) (<-chan graphsync.ResponseProgress, <-chan error)

RequestMany initiates some new GraphSync requests to the given peers using the given selector spec.

func (*ParallelGraphSync) SendUpdate

func (gs *ParallelGraphSync) SendUpdate(ctx context.Context, groupRequestID graphsync.RequestID, extensions ...graphsync.ExtensionData) error

SendUpdate sends an update for an in progress request or response

func (*ParallelGraphSync) Stats

func (gs *ParallelGraphSync) Stats() graphsync.Stats

Stats produces insight on the current state of a graphsync exchange

func (*ParallelGraphSync) Unpause

func (gs *ParallelGraphSync) Unpause(ctx context.Context, groupRequestID graphsync.RequestID, extensions ...graphsync.ExtensionData) error

Unpause unpauses a request or response that was paused Can also send extensions with unpause

func (*ParallelGraphSync) UnregisterPersistenceOption

func (gs *ParallelGraphSync) UnregisterPersistenceOption(name string) error

UnregisterPersistenceOption unregisters an alternate loader/storer combo

Jump to

Keyboard shortcuts

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