summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaidyn Levesque <jadedctrl@teknik.io>2019-06-19 16:28:22 +0000
committerJaidyn Levesque <jadedctrl@teknik.io>2019-06-19 16:28:22 +0000
commitf572f0c0e8fb71563d58157129c849f37a4bfb31 (patch)
treeccb5f69d942c7c29cd2f445f1cce0dc89e72d7ec
parent1b83ff3ddfe28eb53b05a22ffee3ab9da2b4d232 (diff)
downloadcl-ipfs-api2-f572f0c0e8fb71563d58157129c849f37a4bfb31.tar.bz2
cl-ipfs-api2-f572f0c0e8fb71563d58157129c849f37a4bfb31.zip
Add refs calls
-rw-r--r--main.lisp21
-rw-r--r--package.lisp4
2 files changed, 25 insertions, 0 deletions
diff --git a/main.lisp b/main.lisp
index dcca1cd..9e67657 100644
--- a/main.lisp
+++ b/main.lisp
@@ -966,6 +966,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
;; NIL → STRING
diff --git a/package.lisp b/package.lisp
index 97f1545..e305d87 100644
--- a/package.lisp
+++ b/package.lisp
@@ -136,6 +136,10 @@
:pubsub-ls
:pubsub-peers
+ ;; refs calls
+ :refs
+ :refs-local
+
;; version calls
:version
:version-deps))