landscape: amend for setting-store namespacing

This commit is contained in:
Liam Fitzgerald 2021-09-09 11:48:06 +10:00
parent 4f90df272b
commit 8745980f56
7 changed files with 52 additions and 49 deletions

View File

@ -0,0 +1,44 @@
/+ *mip
|%
::
++ settings-0
=< settings
|%
+$ settings (map key bucket)
+$ bucket (map key val)
+$ val
$% [%s p=@t]
[%b p=?]
[%n p=@]
==
--
::
++ settings-1
=< settings
|%
+$ settings (map key bucket)
--
+$ bucket (map key val)
+$ key term
+$ val
$~ [%n 0]
$% [%s p=@t]
[%b p=?]
[%n p=@]
[%a p=(list val)]
==
::
+$ settings (mip desk key bucket)
+$ event
$% [%put-bucket =desk =key =bucket]
[%del-bucket =desk =key]
[%put-entry =desk buc=key =key =val]
[%del-entry =desk buc=key =key]
==
+$ data
$% [%all =settings]
[%bucket =bucket]
[%desk desk=(map key bucket)]
[%entry =val]
==
--

View File

@ -1,44 +0,0 @@
/+ *mip
|%
::
++ settings-0
=< settings
|%
+$ settings (map key bucket)
+$ bucket (map key val)
+$ val
$% [%s p=@t]
[%b p=?]
[%n p=@]
==
--
::
++ settings-1
=< settings
|%
+$ settings (map key bucket)
--
+$ bucket (map key val)
+$ key term
+$ val
$~ [%n 0]
$% [%s p=@t]
[%b p=?]
[%n p=@]
[%a p=(list val)]
==
::
+$ settings (mip desk key bucket)
+$ event
$% [%put-bucket =desk =key =bucket]
[%del-bucket =desk =key]
[%put-entry =desk buc=key =key =val]
[%del-entry =desk buc=key =key]
==
+$ data
$% [%all =settings]
[%bucket =bucket]
[%desk desk=(map key bucket)]
[%entry =val]
==
--

View File

@ -0,0 +1 @@
../../garden-dev/sur/settings.hoon

View File

@ -35,7 +35,6 @@
%observe-hook
%s3-store
%sane
%settings-store
%weather
==
:- %fish

View File

@ -1,7 +1,7 @@
:~ title+'Landscape'
info+'A suite of applications to communicate on Urbit'
color+0xee.5432
glob+'https://bootstrap.urbit.org/glob-0v4.0k6hb.4s38v.su79d.10vd5.7c8lu.glob'
glob-http+'https://bootstrap.urbit.org/glob-0v4.0k6hb.4s38v.su79d.10vd5.7c8lu.glob'
base+'landscape'
version+[0 0 1]
website+'https://tlon.io'

View File

@ -0,0 +1 @@
../../garden-dev/sur/settings.hoon

View File

@ -44,15 +44,16 @@
++ read-setting
|= key=term
=/ m (strand @t) ^- form:m
;< =bowl:spider bind:m get-bowl:strandio
;< has=? bind:m
%+ scry:strandio ?
/gx/settings-store/has-entry/gcp-store/[key]/noun
/gx/settings-store/has-entry/[q.byk.bowl]/gcp-store/[key]/noun
?. has
(strand-fail:strandio (rap 3 %gcp-missing- key ~) ~)
;< =data:settings bind:m
%+ scry:strandio
data:settings
/gx/settings-store/entry/gcp-store/[key]/settings-data
/gx/settings-store/entry/[q.byk.bowl]/gcp-store/[key]/settings-data
?> ?=([%entry %s @] data)
(pure:m p.val.data)
::

View File

@ -40,9 +40,10 @@ b+has
|= key=@tas
=/ m (strand ?)
^- form:m
;< =bowl:spider bind:m get-bowl:strandio
;< has=? bind:m
%+ scry:strandio ?
/gx/settings-store/has-entry/gcp-store/[key]/noun
/gx/settings-store/has-entry/[q.byk.bowl]/gcp-store/[key]/noun
(pure:m has)
::
--