8
8
9
9
iface "github.com/ipfs/boxo/coreiface"
10
10
caopts "github.com/ipfs/boxo/coreiface/options"
11
- "github.com/ipfs/boxo/coreiface/path"
12
11
"github.com/ipfs/boxo/ipld/merkledag"
13
12
ft "github.com/ipfs/boxo/ipld/unixfs"
13
+ "github.com/ipfs/boxo/path"
14
14
"github.com/ipfs/go-cid"
15
15
ipld "github.com/ipfs/go-ipld-format"
16
16
)
@@ -40,7 +40,7 @@ func (api *ObjectAPI) New(ctx context.Context, opts ...caopts.ObjectNewOption) (
40
40
return n , nil
41
41
}
42
42
43
- func (api * ObjectAPI ) Put (ctx context.Context , r io.Reader , opts ... caopts.ObjectPutOption ) (path.Resolved , error ) {
43
+ func (api * ObjectAPI ) Put (ctx context.Context , r io.Reader , opts ... caopts.ObjectPutOption ) (path.ImmutablePath , error ) {
44
44
options , err := caopts .ObjectPutOptions (opts ... )
45
45
if err != nil {
46
46
return nil , err
@@ -62,7 +62,7 @@ func (api *ObjectAPI) Put(ctx context.Context, r io.Reader, opts ...caopts.Objec
62
62
return nil , err
63
63
}
64
64
65
- return path .IpfsPath (c ), nil
65
+ return path .NewIPFSPath (c ), nil
66
66
}
67
67
68
68
func (api * ObjectAPI ) Get (ctx context.Context , p path.Path ) (ipld.Node , error ) {
@@ -153,7 +153,7 @@ func (api *ObjectAPI) Stat(ctx context.Context, p path.Path) (*iface.ObjectStat,
153
153
}, nil
154
154
}
155
155
156
- func (api * ObjectAPI ) AddLink (ctx context.Context , base path.Path , name string , child path.Path , opts ... caopts.ObjectAddLinkOption ) (path.Resolved , error ) {
156
+ func (api * ObjectAPI ) AddLink (ctx context.Context , base path.Path , name string , child path.Path , opts ... caopts.ObjectAddLinkOption ) (path.ImmutablePath , error ) {
157
157
options , err := caopts .ObjectAddLinkOptions (opts ... )
158
158
if err != nil {
159
159
return nil , err
@@ -172,10 +172,10 @@ func (api *ObjectAPI) AddLink(ctx context.Context, base path.Path, name string,
172
172
return nil , err
173
173
}
174
174
175
- return path .IpfsPath (c ), nil
175
+ return path .NewIPFSPath (c ), nil
176
176
}
177
177
178
- func (api * ObjectAPI ) RmLink (ctx context.Context , base path.Path , link string ) (path.Resolved , error ) {
178
+ func (api * ObjectAPI ) RmLink (ctx context.Context , base path.Path , link string ) (path.ImmutablePath , error ) {
179
179
var out objectOut
180
180
err := api .core ().Request ("object/patch/rm-link" , base .String (), link ).
181
181
Exec (ctx , & out )
@@ -188,10 +188,10 @@ func (api *ObjectAPI) RmLink(ctx context.Context, base path.Path, link string) (
188
188
return nil , err
189
189
}
190
190
191
- return path .IpfsPath (c ), nil
191
+ return path .NewIPFSPath (c ), nil
192
192
}
193
193
194
- func (api * ObjectAPI ) AppendData (ctx context.Context , p path.Path , r io.Reader ) (path.Resolved , error ) {
194
+ func (api * ObjectAPI ) AppendData (ctx context.Context , p path.Path , r io.Reader ) (path.ImmutablePath , error ) {
195
195
var out objectOut
196
196
err := api .core ().Request ("object/patch/append-data" , p .String ()).
197
197
FileBody (r ).
@@ -205,10 +205,10 @@ func (api *ObjectAPI) AppendData(ctx context.Context, p path.Path, r io.Reader)
205
205
return nil , err
206
206
}
207
207
208
- return path .IpfsPath (c ), nil
208
+ return path .NewIPFSPath (c ), nil
209
209
}
210
210
211
- func (api * ObjectAPI ) SetData (ctx context.Context , p path.Path , r io.Reader ) (path.Resolved , error ) {
211
+ func (api * ObjectAPI ) SetData (ctx context.Context , p path.Path , r io.Reader ) (path.ImmutablePath , error ) {
212
212
var out objectOut
213
213
err := api .core ().Request ("object/patch/set-data" , p .String ()).
214
214
FileBody (r ).
@@ -222,7 +222,7 @@ func (api *ObjectAPI) SetData(ctx context.Context, p path.Path, r io.Reader) (pa
222
222
return nil , err
223
223
}
224
224
225
- return path .IpfsPath (c ), nil
225
+ return path .NewIPFSPath (c ), nil
226
226
}
227
227
228
228
type change struct {
@@ -246,10 +246,10 @@ func (api *ObjectAPI) Diff(ctx context.Context, a path.Path, b path.Path) ([]ifa
246
246
Path : ch .Path ,
247
247
}
248
248
if ch .Before != cid .Undef {
249
- res [i ].Before = path .IpfsPath (ch .Before )
249
+ res [i ].Before = path .NewIPFSPath (ch .Before )
250
250
}
251
251
if ch .After != cid .Undef {
252
- res [i ].After = path .IpfsPath (ch .After )
252
+ res [i ].After = path .NewIPFSPath (ch .After )
253
253
}
254
254
}
255
255
return res , nil
0 commit comments