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-dms3
Commits
1c3e590c
Commit
1c3e590c
authored
Nov 14, 2017
by
Forrest Weston
Committed by
ForrestWeston
Nov 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add event logging around path resolution
License: MIT Signed-off-by:
Forrest Weston
<
forrest@protocol.ai
>
parent
846c04b1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
0 deletions
+3
-0
core/pathresolver.go
core/pathresolver.go
+1
-0
path/resolver.go
path/resolver.go
+2
-0
No files found.
core/pathresolver.go
View file @
1c3e590c
...
@@ -22,6 +22,7 @@ var ErrNoNamesys = errors.New(
...
@@ -22,6 +22,7 @@ var ErrNoNamesys = errors.New(
// entries and returning the final node.
// entries and returning the final node.
func
Resolve
(
ctx
context
.
Context
,
nsys
namesys
.
NameSystem
,
r
*
path
.
Resolver
,
p
path
.
Path
)
(
node
.
Node
,
error
)
{
func
Resolve
(
ctx
context
.
Context
,
nsys
namesys
.
NameSystem
,
r
*
path
.
Resolver
,
p
path
.
Path
)
(
node
.
Node
,
error
)
{
if
strings
.
HasPrefix
(
p
.
String
(),
"/ipns/"
)
{
if
strings
.
HasPrefix
(
p
.
String
(),
"/ipns/"
)
{
defer
log
.
EventBegin
(
ctx
,
"resolveIpnsPath"
)
.
Done
()
// resolve ipns paths
// resolve ipns paths
// TODO(cryptix): we sould be able to query the local cache for the path
// TODO(cryptix): we sould be able to query the local cache for the path
...
...
path/resolver.go
View file @
1c3e590c
...
@@ -135,6 +135,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
...
@@ -135,6 +135,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
defer
log
.
EventBegin
(
ctx
,
"resolvePathComponents"
,
logging
.
LoggableMap
{
"parts"
:
parts
,
"cid"
:
h
})
.
Done
()
log
.
Debug
(
"resolve dag get"
)
log
.
Debug
(
"resolve dag get"
)
nd
,
err
:=
s
.
DAG
.
Get
(
ctx
,
h
)
nd
,
err
:=
s
.
DAG
.
Get
(
ctx
,
h
)
...
@@ -154,6 +155,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
...
@@ -154,6 +155,7 @@ func (s *Resolver) ResolvePathComponents(ctx context.Context, fpath Path) ([]nod
// would retrieve "baz" in ("bar" in ("foo" in nd.Links).Links).Links
// would retrieve "baz" in ("bar" in ("foo" in nd.Links).Links).Links
func
(
s
*
Resolver
)
ResolveLinks
(
ctx
context
.
Context
,
ndd
node
.
Node
,
names
[]
string
)
([]
node
.
Node
,
error
)
{
func
(
s
*
Resolver
)
ResolveLinks
(
ctx
context
.
Context
,
ndd
node
.
Node
,
names
[]
string
)
([]
node
.
Node
,
error
)
{
defer
log
.
EventBegin
(
ctx
,
"resolveLinks"
,
logging
.
LoggableMap
{
"names"
:
names
})
.
Done
()
result
:=
make
([]
node
.
Node
,
0
,
len
(
names
)
+
1
)
result
:=
make
([]
node
.
Node
,
0
,
len
(
names
)
+
1
)
result
=
append
(
result
,
ndd
)
result
=
append
(
result
,
ndd
)
nd
:=
ndd
// dup arg workaround
nd
:=
ndd
// dup arg workaround
...
...
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