mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 14:42:02 +03:00
graph-store: cleaned up structures
This commit is contained in:
parent
fcfcf95aed
commit
83ec7eae24
@ -5,7 +5,6 @@
|
||||
$% state-0
|
||||
==
|
||||
+$ state-0 [%0 network:store]
|
||||
++ ordered-graph ((ordered-map ,time ,node:store) gth)
|
||||
--
|
||||
::
|
||||
=| state-0
|
||||
|
@ -1,23 +1,35 @@
|
||||
/- *post
|
||||
|%
|
||||
++ 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
|
||||
::
|
||||
+$ network
|
||||
$: graphs=(map resource graph)
|
||||
tags=(set term)
|
||||
tag-queries=(map term resources)
|
||||
==
|
||||
::
|
||||
+$ internal-graph (tree [key=time val=node])
|
||||
+$ graph
|
||||
$~ [%empty ~]
|
||||
$% [%graph u=internal-graph]
|
||||
[%empty ~]
|
||||
+$ graph ((mop atom node) lte)
|
||||
+$ internal-graph
|
||||
$~ [%not-loaded ~]
|
||||
$% ::
|
||||
:: a graph and timestamp of when it was last modified
|
||||
[%graph p=graph q=time]
|
||||
[%empty-when-fetched p=time]
|
||||
[%not-loaded ~]
|
||||
==
|
||||
+$ node [=post replies=graph]
|
||||
::
|
||||
+$ node [=post children=internal-graph]
|
||||
+$ action
|
||||
$% [%add-graph =resource =graph]
|
||||
[%remove-graph =resource]
|
||||
::
|
||||
[%add-nodes uids=(set [=uid =node])]
|
||||
[%add-nodes nodes=(map uid node)]
|
||||
[%remove-nodes uids=(set uid)]
|
||||
::
|
||||
[%add-signatures =uid =signatures]
|
||||
|
26
pkg/arvo/sur/post.hoon
Normal file
26
pkg/arvo/sur/post.hoon
Normal file
@ -0,0 +1,26 @@
|
||||
/- *resource
|
||||
|%
|
||||
+$ atom @
|
||||
+$ index (list atom)
|
||||
+$ uid [=resource =index]
|
||||
::
|
||||
+$ hash @ux
|
||||
+$ signature @ux
|
||||
+$ signatures (set signature)
|
||||
+$ post
|
||||
$: author=ship
|
||||
=hash
|
||||
=index
|
||||
contents=(list content)
|
||||
signatures=[p=signatures q=hash]
|
||||
time-sent=time
|
||||
==
|
||||
::
|
||||
+$ content
|
||||
$% [%text =cord]
|
||||
[%url =cord]
|
||||
[%code expression=cord output=(list tank)]
|
||||
[%reference =uid]
|
||||
:: [%cage =cage]
|
||||
==
|
||||
--
|
10
pkg/arvo/sur/resource.hoon
Normal file
10
pkg/arvo/sur/resource.hoon
Normal file
@ -0,0 +1,10 @@
|
||||
|%
|
||||
+$ resource [=entity =term]
|
||||
+$ resources (set resource)
|
||||
::
|
||||
+$ entity
|
||||
$@ ship
|
||||
$% [%ships ships=(set ship)]
|
||||
:: [%ring ...]
|
||||
==
|
||||
--
|
Loading…
Reference in New Issue
Block a user