graphsync

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2020 License: Apache-2.0, MIT Imports: 15 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,
	ipldBridge ipldbridge.IPLDBridge, loader ipldbridge.Loader,
	storer ipldbridge.Storer) graphsync.GraphExchange

New creates a new GraphSync Exchange on the given network, using the given bridge to IPLD and the given link loader.

Types

type GraphSync

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

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

func (*GraphSync) RegisterRequestReceivedHook

func (gs *GraphSync) RegisterRequestReceivedHook(hook graphsync.OnRequestReceivedHook) error

RegisterRequestReceivedHook 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 (*GraphSync) RegisterResponseReceivedHook

func (gs *GraphSync) RegisterResponseReceivedHook(hook graphsync.OnResponseReceivedHook) error

RegisterResponseReceivedHook adds a hook that runs when a response is received

func (*GraphSync) Request

func (gs *GraphSync) 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.

Jump to

Keyboard shortcuts

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