Browse code

Add refs calls

Jaidyn Levesque authored on 2019-06-19 16:28:22
Showing 2 changed files
... ...
@@ -965,6 +965,27 @@
965 965
 
966 966
 
967 967
 
968
+;; —————————————————————————————————————
969
+;; REFS CALLS
970
+
971
+;; STRING [:BOOLEAN :BOOLEAN :NUMBER] → ALIST || (NIL STRING)
972
+(defun refs (path &key (unique "") (recursive "") (max-depth -1))
973
+  "List links (references) from an object.
974
+  /ipns/docs.ipfs.io/reference/api/http/#api-v0-refs"
975
+  (bind-api-alist
976
+    (ipfs-call "refs" `(("arg" ,path)("max-depth" ,max-depth)
977
+			,(if (not (empty-string-p recursive))
978
+			   `("recursive" ,recursive))))))
979
+
980
+;; NIL → ALIST || (NIL STRING)
981
+(defun refs-local ()
982
+  "List all local references.
983
+  /ipns/docs.ipfs.io/reference/api/http/#api-v0-refs-local"
984
+  (bind-api-alist (ipfs-call "refs/local" '())))
985
+
986
+
987
+
988
+
968 989
 ;; —————————————————————————————————————
969 990
 ;; VERSION CALLS
970 991
 
... ...
@@ -136,6 +136,10 @@
136 136
     :pubsub-ls
137 137
     :pubsub-peers
138 138
 
139
+    ;; refs calls
140
+    :refs
141
+    :refs-local
142
+
139 143
     ;; version calls
140 144
     :version
141 145
     :version-deps))