From cbc8e148c161d06f383a8cccd7dabb9116038beb Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Mon, 31 Mar 2025 23:53:12 +0100 Subject: [PATCH] Add missing schema --- trustgraph-base/trustgraph/schema/config.py | 44 +++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 trustgraph-base/trustgraph/schema/config.py diff --git a/trustgraph-base/trustgraph/schema/config.py b/trustgraph-base/trustgraph/schema/config.py new file mode 100644 index 00000000..a95359fb --- /dev/null +++ b/trustgraph-base/trustgraph/schema/config.py @@ -0,0 +1,44 @@ + +from pulsar.schema import Record, Bytes, String, Boolean, Array, Map, Integer + +from . topic import topic +from . types import Error, RowSchema + +############################################################################ + +# Prompt services, abstract the prompt generation + +class ConfigItem(Record): + key = String() + value = String() + +class ConfigItems(Record): + items = Map(String()) + +class ConfigRequest(Record): + type = String() + key = String() + operation = String() # get, list, getall, delete, put, dump + +class ConfigResponse(Record): + value = String() + directory = Array(String()) + values = Map(String()) + config = Map(Map(String())) + error = Error() + +class ConfigPush(Record): + config = Map(ConfigItems()) + +config_request_queue = topic( + 'prompt', kind='non-persistent', namespace='request' +) +config_response_queue = topic( + 'prompt', kind='non-persistent', namespace='response' +) +config_push_queue = topic( + 'prompt', kind='non-persistent', namespace='config'b +) + +############################################################################ +