graph-store: cleaned up structures

This commit is contained in:
Logan Allen 2020-06-02 15:44:22 -04:00
parent fcfcf95aed
commit 83ec7eae24
4 changed files with 55 additions and 8 deletions

View File

@ -5,7 +5,6 @@
$% state-0
==
+$ state-0 [%0 network:store]
++ ordered-graph ((ordered-map ,time ,node:store) gth)
--
::
=| state-0

View File

@ -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
View 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]
==
--

View File

@ -0,0 +1,10 @@
|%
+$ resource [=entity =term]
+$ resources (set resource)
::
+$ entity
$@ ship
$% [%ships ships=(set ship)]
:: [%ring ...]
==
--