urbit/pkg/arvo/sur/graph-store.hoon

60 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-06-02 00:07:31 +03:00
/- *post
|%
2020-06-02 22:44:22 +03:00
++ mop
|* [key=mold value=mold]
|= ord=$-([key key] ?)
|= a=*
=/ b ;;((tree [key=key val=value]) a)
?> (check-balance:((ordered-map key value) ord) b)
b
::
+$ graph ((mop atom node) gth)
+$ node [=post children=internal-graph]
+$ graphs (map resource graph)
+$ tag-queries (jug term resource)
+$ update-log ((mop time update) gth)
+$ update-logs (map resource update-log)
2020-06-12 21:02:52 +03:00
::
2020-06-02 22:44:22 +03:00
+$ internal-graph
2020-06-05 23:11:04 +03:00
$~ [%empty ~]
$% [%graph p=graph]
2020-06-05 23:11:04 +03:00
[%empty ~]
2020-06-02 00:07:31 +03:00
==
2020-06-02 22:44:22 +03:00
::
+$ network
$: =graphs
=tag-queries
=update-logs
archive=graphs
==
::
+$ update
$% [%0 p=time q=update-0]
==
::
+$ update-0
$% [%add-graph =resource =graph]
2020-06-02 00:07:31 +03:00
[%remove-graph =resource]
::
[%add-nodes =resource nodes=(map index node)]
[%remove-nodes =resource indices=(set index)]
2020-06-02 00:07:31 +03:00
::
[%add-signatures =uid =signatures]
[%remove-signatures =uid =signatures]
::
[%add-tag =term =resource]
[%remove-tag =term =resource]
::
[%archive-graph =resource]
[%unarchive-graph =resource]
::
[%run-updates =resource =update-log]
::
:: NOTE: cannot be sent as pokes
::
[%keys =resources]
[%tags tags=(set term)]
[%tag-queries =tag-queries]
2020-06-02 00:07:31 +03:00
==
--