Documentation ¶
Index ¶
- func New(parent context.Context, network gsnet.GraphSyncNetwork, ...) graphsync.GraphExchange
- type GraphSync
- func (gs *GraphSync) RegisterRequestReceivedHook(hook graphsync.OnRequestReceivedHook) error
- func (gs *GraphSync) RegisterResponseReceivedHook(hook graphsync.OnResponseReceivedHook) error
- func (gs *GraphSync) Request(ctx context.Context, p peer.ID, root ipld.Link, selector ipld.Node, ...) (<-chan graphsync.ResponseProgress, <-chan error)
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 ¶
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 ¶
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.