-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
coreapi: be more flexible about inputs
While coreapi functions previously only accepted path strings, they now accept anything from Path structs and strings, Multihash structs and strings, and most notably: Cid structs, strings and byte arrays. See go-cid.Parse() for more information. If the argument is a string containing at least one forward-slash, it's treated as a path and resolved accordingly, i.e. including IPNS resolution and link traversal. Anything else will be parsed as a Cid and fetched directly using DAG.Get(). This change makes various use cases of the Core API more efficient, since there's no more need for expensive string/Path/Cid conversions. License: MIT Signed-off-by: Lars Gierth <[email protected]>
- Loading branch information
Lars Gierth
committed
Dec 9, 2016
1 parent
e1c190a
commit 2e15ba9
Showing
3 changed files
with
44 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters