Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
finish server poc
Browse files Browse the repository at this point in the history
  • Loading branch information
guseggert committed Oct 20, 2022
1 parent 2138949 commit 7ef7bd8
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 297 deletions.
6 changes: 1 addition & 5 deletions client/findproviders.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ import (
"github.com/multiformats/go-multicodec"
)

type findProvidersResponse struct {
Providers []delegatedrouting.Provider
}

func (fp *Client) FindProviders(ctx context.Context, key cid.Cid) ([]peer.AddrInfo, error) {
url := path.Join(fp.baseURL, "providers", key.String())
req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
Expand All @@ -33,7 +29,7 @@ func (fp *Client) FindProviders(ctx context.Context, key cid.Cid) ([]peer.AddrIn
return nil, httpError(resp.StatusCode, resp.Body)
}

parsedResp := &findProvidersResponse{}
parsedResp := &delegatedrouting.FindProvidersResult{}
err = json.NewDecoder(resp.Body).Decode(parsedResp)
if err != nil {
return nil, err
Expand Down
Loading

0 comments on commit 7ef7bd8

Please sign in to comment.