Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-path
Commits
16bf087f
Commit
16bf087f
authored
Apr 20, 2018
by
Łukasz Magiera
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
coreapi: path review
License: MIT Signed-off-by:
Łukasz Magiera
<
magik6k@gmail.com
>
parent
e0565d2f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
resolver/resolver.go
resolver/resolver.go
+4
-1
No files found.
resolver/resolver.go
View file @
16bf087f
...
...
@@ -34,6 +34,9 @@ func (e ErrNoLink) Error() string {
return
fmt
.
Sprintf
(
"no link named %q under %s"
,
e
.
Name
,
e
.
Node
.
String
())
}
// ResolveOnce resolves path through a single node
type
ResolveOnce
func
(
ctx
context
.
Context
,
ds
ipld
.
NodeGetter
,
nd
ipld
.
Node
,
names
[]
string
)
(
*
ipld
.
Link
,
[]
string
,
error
)
// Resolver provides path resolution to IPFS
// It has a pointer to a DAGService, which is uses to resolve nodes.
// TODO: now that this is more modular, try to unify this code with the
...
...
@@ -41,7 +44,7 @@ func (e ErrNoLink) Error() string {
type
Resolver
struct
{
DAG
ipld
.
NodeGetter
ResolveOnce
func
(
ctx
context
.
Context
,
ds
ipld
.
NodeGetter
,
nd
ipld
.
Node
,
names
[]
string
)
(
*
ipld
.
Link
,
[]
string
,
error
)
ResolveOnce
ResolveOnce
}
// NewBasicResolver constructs a new basic resolver.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment