Add refs calls

This commit is contained in:
Jaidyn Levesque 2019-06-19 11:28:22 -05:00
parent 1b83ff3ddf
commit f572f0c0e8
2 changed files with 25 additions and 0 deletions

View File

@ -965,6 +965,27 @@
;; —————————————————————————————————————
;; REFS CALLS
;; STRING [:BOOLEAN :BOOLEAN :NUMBER] → ALIST || (NIL STRING)
(defun refs (path &key (unique "") (recursive "") (max-depth -1))
"List links (references) from an object.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-refs"
(bind-api-alist
(ipfs-call "refs" `(("arg" ,path)("max-depth" ,max-depth)
,(if (not (empty-string-p recursive))
`("recursive" ,recursive))))))
;; NIL → ALIST || (NIL STRING)
(defun refs-local ()
"List all local references.
/ipns/docs.ipfs.io/reference/api/http/#api-v0-refs-local"
(bind-api-alist (ipfs-call "refs/local" '())))
;; ————————————————————————————————————— ;; —————————————————————————————————————
;; VERSION CALLS ;; VERSION CALLS

View File

@ -136,6 +136,10 @@
:pubsub-ls :pubsub-ls
:pubsub-peers :pubsub-peers
;; refs calls
:refs
:refs-local
;; version calls ;; version calls
:version :version
:version-deps)) :version-deps))