Skip to content

Commit

Permalink
style(lint): remove unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
hannahhoward committed Jan 25, 2024
1 parent 471422a commit 0997fb8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
24 changes: 0 additions & 24 deletions pkg/indexerlookup/candidatesource.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,6 @@ func NewCandidateSource(o ...Option) (*IndexerCandidateSource, error) {
}, nil
}

func (idxf *IndexerCandidateSource) sendJsonRequest(req *http.Request) (*model.FindResponse, error) {
req.Header.Set("Accept", "application/json")
logger.Debugw("sending outgoing request", "url", req.URL, "accept", req.Header.Get("Accept"))
resp, err := idxf.httpClient.Do(req)
if err != nil {
logger.Debugw("Failed to perform json lookup", "err", err)
return nil, err
}
switch resp.StatusCode {
case http.StatusOK:
defer resp.Body.Close()
b, err := io.ReadAll(resp.Body)
if err != nil {
logger.Debugw("Failed to read response JSON response body", "err", err)
return nil, err
}
return model.UnmarshalFindResponse(b)
case http.StatusNotFound:
return &model.FindResponse{}, nil
default:
return nil, fmt.Errorf("batch find query failed: %s", http.StatusText(resp.StatusCode))
}
}

func decodeMetadata(pr model.ProviderResult) (metadata.Metadata, error) {
if len(pr.Metadata) == 0 {
return metadata.Metadata{}, errors.New("no metadata")
Expand Down
15 changes: 0 additions & 15 deletions pkg/retriever/assignablecandidatefinder.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import (
"github.com/filecoin-project/lassie/pkg/events"
"github.com/filecoin-project/lassie/pkg/internal/candidatebuffer"
"github.com/filecoin-project/lassie/pkg/types"
"github.com/ipfs/go-cid"
"github.com/ipni/go-libipni/metadata"
"github.com/libp2p/go-libp2p/core/peer"
)

type FilterIndexerCandidate func(types.RetrievalCandidate) (bool, types.RetrievalCandidate)
Expand Down Expand Up @@ -82,15 +79,3 @@ func (acf AssignableCandidateFinder) FindCandidates(ctx context.Context, request
}
return nil
}

func sendFixedPeers(requestCid cid.Cid, fixedPeers []peer.AddrInfo, onNextCandidate candidatebuffer.OnNextCandidate) error {
md := metadata.Default.New(&metadata.GraphsyncFilecoinV1{}, &metadata.Bitswap{}, &metadata.IpfsGatewayHttp{})
for _, fixedPeer := range fixedPeers {
onNextCandidate(types.RetrievalCandidate{
MinerPeer: fixedPeer,
RootCid: requestCid,
Metadata: md,
})
}
return nil
}

0 comments on commit 0997fb8

Please sign in to comment.