We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2862dc2 commit 342b01dCopy full SHA for 342b01d
routing/http/types/ipfs.go
@@ -3,28 +3,9 @@ package types
3
import (
4
"encoding/json"
5
6
- "github.com/ipfs/boxo/routing/http/internal/drjson"
7
- "github.com/ipfs/go-cid"
8
"github.com/multiformats/go-multiaddr"
9
)
10
11
-type CID struct{ cid.Cid }
12
-
13
-func (c *CID) MarshalJSON() ([]byte, error) { return drjson.MarshalJSONBytes(c.String()) }
14
-func (c *CID) UnmarshalJSON(b []byte) error {
15
- var s string
16
- err := json.Unmarshal(b, &s)
17
- if err != nil {
18
- return err
19
- }
20
- decodedCID, err := cid.Decode(s)
21
22
23
24
- c.Cid = decodedCID
25
- return nil
26
-}
27
28
type Multiaddr struct{ multiaddr.Multiaddr }
29
30
func (m *Multiaddr) UnmarshalJSON(b []byte) error {
0 commit comments