urbit/pkg/arvo/lib/graph.hoon

57 lines
1.2 KiB
Plaintext
Raw Normal View History

/- *resource
/+ store=graph-store
|_ =bowl:gall
2020-06-27 00:13:12 +03:00
++ scry-for
|* [=mold =path]
.^ mold
%gx
(scot %p our.bowl)
%graph-store
(scot %da now.bowl)
(snoc `^path`path %noun)
==
::
++ get-graph
|= res=resource
2020-09-04 10:42:20 +03:00
^- update:store
%+ scry-for update:store
2020-07-07 03:02:15 +03:00
/graph/(scot %p entity.res)/[name.res]
::
2020-11-03 21:10:57 +03:00
++ got-node
2020-11-03 03:19:58 +03:00
|= [res=resource =index:store]
^- node:store
=+ %+ scry-for ,=update:store
%+ weld
/node/(scot %p entity.res)/[name.res]
(turn index (cury scot %ud))
?> ?=(%0 -.update)
?> ?=(%add-nodes -.q.update)
?> ?=(^ nodes.q.update)
q.n.nodes.q.update
::
2020-09-04 10:42:20 +03:00
++ get-update-log
|= rid=resource
^- update-log:store
%+ scry-for update-log:store
/update-log/(scot %p entity.rid)/[name.rid]
::
2020-08-19 22:22:20 +03:00
++ peek-update-log
|= res=resource
^- (unit time)
(scry-for (unit time) /peek-update-log/(scot %p entity.res)/[name.res])
2020-08-19 22:22:20 +03:00
::
++ get-update-log-subset
|= [res=resource start=@da]
^- update-log:store
%+ scry-for update-log:store
/update-log-subset/(scot %p entity.res)/[name.res]/(scot %da start)/'~'
2020-11-03 10:20:01 +03:00
::
++ get-keys
^- resources
=+ %+ scry-for ,=update:store
/keys
?> ?=(%0 -.update)
?> ?=(%keys -.q.update)
resources.q.update
2020-06-27 00:13:12 +03:00
--