packagerequestmanagerimport("context""github.com/ipfs/go-graphsync/ipldbridge"gsmsg"github.com/ipfs/go-graphsync/message""github.com/ipfs/go-graphsync/metadata"ipld"github.com/ipld/go-ipld-prime")funcvisitToChannel(ctxcontext.Context,inProgressChanchanResponseProgress)ipldbridge.AdvVisitFn{returnfunc(tpipldbridge.TraversalProgress,nodeipld.Node,tripldbridge.TraversalReason)error{select{case<-ctx.Done():caseinProgressChan<-ResponseProgress{Node:node,Path:tp.Path,LastBlock:tp.LastBlock,}:}returnnil}}funcmetadataForResponses(responses[]gsmsg.GraphSyncResponse,ipldBridgeipldbridge.IPLDBridge)map[gsmsg.GraphSyncRequestID]metadata.Metadata{responseMetadata:=make(map[gsmsg.GraphSyncRequestID]metadata.Metadata,len(responses))for_,response:=rangeresponses{md,err:=metadata.DecodeMetadata(response.Extra(),ipldBridge)iferr!=nil{log.Warningf("Unable to decode metadata in response for request id: %d",response.RequestID())continue}responseMetadata[response.RequestID()]=md}returnresponseMetadata}