2020-03-01 03:31:05 +03:00
|
|
|
:: metadata: helpers for getting data from the metadata-store
|
|
|
|
::
|
|
|
|
/- *metadata-store
|
2021-01-13 07:05:22 +03:00
|
|
|
/+ resource
|
2020-03-01 03:31:05 +03:00
|
|
|
::
|
|
|
|
|_ =bowl:gall
|
|
|
|
++ app-paths-from-group
|
2021-01-12 07:26:19 +03:00
|
|
|
|= [=app-name group=resource]
|
|
|
|
^- (list resource)
|
2020-03-01 03:31:05 +03:00
|
|
|
%+ murn
|
|
|
|
%~ tap in
|
2021-01-12 07:26:19 +03:00
|
|
|
=- (~(gut by -) group ~)
|
|
|
|
.^ (jug resource md-resource)
|
2020-03-01 03:31:05 +03:00
|
|
|
%gy
|
|
|
|
(scot %p our.bowl)
|
|
|
|
%metadata-store
|
|
|
|
(scot %da now.bowl)
|
|
|
|
/group-indices
|
|
|
|
==
|
2020-06-08 10:53:16 +03:00
|
|
|
|= =md-resource
|
2021-01-12 07:26:19 +03:00
|
|
|
^- (unit resource)
|
2020-06-08 10:53:16 +03:00
|
|
|
?. =(app-name.md-resource app-name) ~
|
2021-01-12 07:26:19 +03:00
|
|
|
`resource.md-resource
|
2020-03-01 03:31:05 +03:00
|
|
|
::
|
2021-01-13 07:50:37 +03:00
|
|
|
++ metadata-for-group
|
|
|
|
|= group=resource
|
|
|
|
.^ associations
|
|
|
|
%gx (scot %p our.bowl) %metadata-store (scot %da now.bowl)
|
2021-01-14 01:50:39 +03:00
|
|
|
%group (snoc (en-path:resource group) %noun)
|
2021-01-13 07:50:37 +03:00
|
|
|
==
|
|
|
|
::
|
|
|
|
++ md-resources-from-group
|
|
|
|
|= group=resource
|
|
|
|
=- (~(get ju -) group)
|
|
|
|
.^ (jug resource md-resource)
|
|
|
|
%gy
|
|
|
|
(scot %p our.bowl)
|
|
|
|
%metadata-store
|
|
|
|
(scot %da now.bowl)
|
|
|
|
/group-indices
|
|
|
|
==
|
|
|
|
::
|
2021-01-13 07:05:22 +03:00
|
|
|
++ peek-association
|
|
|
|
|= [app-name=term rid=resource]
|
|
|
|
.^ (unit association)
|
2020-10-22 04:29:35 +03:00
|
|
|
%gx (scot %p our.bowl) %metadata-store (scot %da now.bowl)
|
2021-01-14 01:50:39 +03:00
|
|
|
%metadata app-name (snoc (en-path:resource rid) %noun)
|
2020-10-22 04:29:35 +03:00
|
|
|
==
|
|
|
|
::
|
2021-01-13 07:05:22 +03:00
|
|
|
++ peek-metadata
|
2021-01-12 07:26:19 +03:00
|
|
|
|= =md-resource
|
2021-01-13 07:05:22 +03:00
|
|
|
%+ bind (peek-association md-resource)
|
|
|
|
|=(association metadata)
|
2020-10-22 04:29:35 +03:00
|
|
|
::
|
2021-01-13 07:05:22 +03:00
|
|
|
++ peek-group
|
2020-06-08 10:53:16 +03:00
|
|
|
|= =md-resource
|
2021-01-14 01:50:39 +03:00
|
|
|
^- (unit resource)
|
2021-01-13 07:05:22 +03:00
|
|
|
%+ bind (peek-association md-resource)
|
|
|
|
|=(association group)
|
2020-06-08 10:53:16 +03:00
|
|
|
--
|