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-graphsync
Commits
d6fbc28b
Commit
d6fbc28b
authored
Mar 11, 2019
by
hannahhoward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(ipldbridge): add comments
parent
b6c8a00e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
ipldbridge/ipldbridge.go
ipldbridge/ipldbridge.go
+14
-0
No files found.
ipldbridge/ipldbridge.go
View file @
d6fbc28b
...
...
@@ -39,10 +39,24 @@ type TraversalReason = ipldtraversal.TraversalReason
// IPLDBridge is an interface for making calls to IPLD, which can be
// replaced with alternative implementations
type
IPLDBridge
interface
{
// ComposeLinkLoader converts a raw block loader into an IPLD node loader.
ComposeLinkLoader
(
actualLoader
RawLoader
)
LinkLoader
// ValidateSelectorSpec verifies if a node matches the selector spec.
ValidateSelectorSpec
(
cidRootedSelector
ipld
.
Node
)
[]
error
// EncodeNode encodes an IPLD Node to bytes for network transfer.
EncodeNode
(
ipld
.
Node
)
([]
byte
,
error
)
// DecodeNode decodes bytes crossing a network to an IPLD Node.
DecodeNode
([]
byte
)
(
ipld
.
Node
,
error
)
// DecodeSelectorSpec checks if a generic IPLD node is a selector spec,
// and if so, converts it to a root node and a go-ipld-prime Selector.
DecodeSelectorSpec
(
cidRootedSelector
ipld
.
Node
)
(
ipld
.
Node
,
Selector
,
error
)
// Traverse performs a selector traversal, starting at a given root, using the given selector,
// and the given link loader. The given visit function will be called for each node
// visited.
Traverse
(
ctx
context
.
Context
,
loader
LinkLoader
,
root
ipld
.
Node
,
s
Selector
,
fn
AdvVisitFn
)
error
}
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