moat-kv 0.71.0__py3-none-any.whl → 0.71.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- moat/kv/__init__.py +6 -7
- moat/kv/_cfg.yaml +3 -2
- moat/kv/actor/__init__.py +2 -1
- moat/kv/actor/deletor.py +4 -1
- moat/kv/auth/__init__.py +12 -13
- moat/kv/auth/_test.py +4 -1
- moat/kv/auth/password.py +11 -7
- moat/kv/backend/mqtt.py +4 -5
- moat/kv/client.py +20 -39
- moat/kv/code.py +3 -3
- moat/kv/command/data.py +4 -3
- moat/kv/command/dump/__init__.py +36 -34
- moat/kv/command/internal.py +2 -3
- moat/kv/command/job.py +1 -2
- moat/kv/command/type.py +3 -6
- moat/kv/data.py +9 -8
- moat/kv/errors.py +16 -8
- moat/kv/mock/__init__.py +2 -12
- moat/kv/model.py +29 -33
- moat/kv/obj/__init__.py +3 -3
- moat/kv/obj/command.py +3 -3
- moat/kv/runner.py +4 -5
- moat/kv/server.py +106 -126
- moat/kv/types.py +10 -12
- {moat_kv-0.71.0.dist-info → moat_kv-0.71.7.dist-info}/METADATA +6 -2
- moat_kv-0.71.7.dist-info/RECORD +47 -0
- {moat_kv-0.71.0.dist-info → moat_kv-0.71.7.dist-info}/WHEEL +1 -1
- moat_kv-0.71.7.dist-info/licenses/LICENSE +3 -0
- moat_kv-0.71.7.dist-info/licenses/LICENSE.APACHE2 +202 -0
- moat_kv-0.71.7.dist-info/licenses/LICENSE.MIT +20 -0
- moat_kv-0.71.7.dist-info/top_level.txt +1 -0
- build/lib/docs/source/conf.py +0 -201
- build/lib/examples/pathify.py +0 -45
- build/lib/moat/kv/__init__.py +0 -19
- build/lib/moat/kv/_cfg.yaml +0 -93
- build/lib/moat/kv/_main.py +0 -91
- build/lib/moat/kv/actor/__init__.py +0 -98
- build/lib/moat/kv/actor/deletor.py +0 -139
- build/lib/moat/kv/auth/__init__.py +0 -444
- build/lib/moat/kv/auth/_test.py +0 -166
- build/lib/moat/kv/auth/password.py +0 -234
- build/lib/moat/kv/auth/root.py +0 -58
- build/lib/moat/kv/backend/__init__.py +0 -67
- build/lib/moat/kv/backend/mqtt.py +0 -71
- build/lib/moat/kv/client.py +0 -1025
- build/lib/moat/kv/code.py +0 -236
- build/lib/moat/kv/codec.py +0 -11
- build/lib/moat/kv/command/__init__.py +0 -1
- build/lib/moat/kv/command/acl.py +0 -180
- build/lib/moat/kv/command/auth.py +0 -261
- build/lib/moat/kv/command/code.py +0 -293
- build/lib/moat/kv/command/codec.py +0 -186
- build/lib/moat/kv/command/data.py +0 -265
- build/lib/moat/kv/command/dump/__init__.py +0 -143
- build/lib/moat/kv/command/error.py +0 -149
- build/lib/moat/kv/command/internal.py +0 -248
- build/lib/moat/kv/command/job.py +0 -433
- build/lib/moat/kv/command/log.py +0 -53
- build/lib/moat/kv/command/server.py +0 -114
- build/lib/moat/kv/command/type.py +0 -201
- build/lib/moat/kv/config.py +0 -46
- build/lib/moat/kv/data.py +0 -216
- build/lib/moat/kv/errors.py +0 -561
- build/lib/moat/kv/exceptions.py +0 -126
- build/lib/moat/kv/mock/__init__.py +0 -101
- build/lib/moat/kv/mock/mqtt.py +0 -159
- build/lib/moat/kv/mock/tracer.py +0 -63
- build/lib/moat/kv/model.py +0 -1069
- build/lib/moat/kv/obj/__init__.py +0 -646
- build/lib/moat/kv/obj/command.py +0 -241
- build/lib/moat/kv/runner.py +0 -1347
- build/lib/moat/kv/server.py +0 -2809
- build/lib/moat/kv/types.py +0 -513
- ci/rtd-requirements.txt +0 -4
- ci/test-requirements.txt +0 -7
- ci/travis.sh +0 -96
- debian/.gitignore +0 -7
- debian/changelog +0 -1435
- debian/control +0 -43
- debian/moat-kv/usr/lib/python3/dist-packages/docs/source/conf.py +0 -201
- debian/moat-kv/usr/lib/python3/dist-packages/examples/pathify.py +0 -45
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/__init__.py +0 -19
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/_cfg.yaml +0 -93
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/_main.py +0 -91
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/actor/__init__.py +0 -98
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/actor/deletor.py +0 -139
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/__init__.py +0 -444
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/_test.py +0 -166
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/password.py +0 -234
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/root.py +0 -58
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/backend/__init__.py +0 -67
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/backend/mqtt.py +0 -71
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/client.py +0 -1025
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/code.py +0 -236
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/codec.py +0 -11
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/__init__.py +0 -1
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/acl.py +0 -180
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/auth.py +0 -261
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/code.py +0 -293
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/codec.py +0 -186
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/data.py +0 -265
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/dump/__init__.py +0 -143
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/error.py +0 -149
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/internal.py +0 -248
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/job.py +0 -433
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/log.py +0 -53
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/server.py +0 -114
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/type.py +0 -201
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/config.py +0 -46
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/data.py +0 -216
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/errors.py +0 -561
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/exceptions.py +0 -126
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/mock/__init__.py +0 -101
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/mock/mqtt.py +0 -159
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/mock/tracer.py +0 -63
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/model.py +0 -1069
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/obj/__init__.py +0 -646
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/obj/command.py +0 -241
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/runner.py +0 -1347
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/server.py +0 -2809
- debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/types.py +0 -513
- debian/moat-kv.postinst +0 -3
- debian/rules +0 -20
- debian/source/format +0 -1
- debian/watch +0 -4
- docs/Makefile +0 -20
- docs/make.bat +0 -36
- docs/source/TODO.rst +0 -61
- docs/source/_static/.gitkeep +0 -0
- docs/source/acls.rst +0 -80
- docs/source/auth.rst +0 -84
- docs/source/client_protocol.rst +0 -456
- docs/source/code.rst +0 -341
- docs/source/command_line.rst +0 -1187
- docs/source/common_protocol.rst +0 -47
- docs/source/conf.py +0 -201
- docs/source/debugging.rst +0 -70
- docs/source/extend.rst +0 -37
- docs/source/history.rst +0 -36
- docs/source/index.rst +0 -75
- docs/source/model.rst +0 -54
- docs/source/overview.rst +0 -83
- docs/source/related.rst +0 -89
- docs/source/server_protocol.rst +0 -450
- docs/source/startup.rst +0 -31
- docs/source/translator.rst +0 -244
- docs/source/tutorial.rst +0 -711
- docs/source/v3.rst +0 -168
- examples/code/transform.scale.yml +0 -21
- examples/code/transform.switch.yml +0 -82
- examples/code/transform.timeslot.yml +0 -63
- examples/pathify.py +0 -45
- moat/kv/codec.py +0 -11
- moat_kv-0.71.0.dist-info/RECORD +0 -188
- moat_kv-0.71.0.dist-info/top_level.txt +0 -9
- scripts/current +0 -15
- scripts/env +0 -8
- scripts/init +0 -39
- scripts/recover +0 -17
- scripts/rotate +0 -33
- scripts/run +0 -29
- scripts/run-all +0 -10
- scripts/run-any +0 -10
- scripts/run-single +0 -15
- scripts/success +0 -4
- systemd/moat-kv-recover.service +0 -21
- systemd/moat-kv-rotate.service +0 -20
- systemd/moat-kv-rotate.timer +0 -10
- systemd/moat-kv-run-all.service +0 -26
- systemd/moat-kv-run-all@.service +0 -25
- systemd/moat-kv-run-any.service +0 -26
- systemd/moat-kv-run-any@.service +0 -25
- systemd/moat-kv-run-single.service +0 -26
- systemd/moat-kv-run-single@.service +0 -25
- systemd/moat-kv.service +0 -27
- systemd/postinst +0 -7
- systemd/sysusers +0 -3
- {moat_kv-0.71.0.dist-info → moat_kv-0.71.7.dist-info}/licenses/LICENSE.txt +0 -0
docs/source/v3.rst
DELETED
@@ -1,168 +0,0 @@
|
|
1
|
-
=================
|
2
|
-
MoaT-KV Version 3
|
3
|
-
=================
|
4
|
-
|
5
|
-
+++++++++
|
6
|
-
Rationale
|
7
|
-
+++++++++
|
8
|
-
|
9
|
-
The V2 servers worked, for the most part, but they had a couple of problems.
|
10
|
-
|
11
|
-
* sometimes there are strange deadlocks
|
12
|
-
|
13
|
-
* msgpack isn't that widely supported compared to CBOR
|
14
|
-
|
15
|
-
* the initial client/server negotiation isn't versioned
|
16
|
-
|
17
|
-
* the sync protocol is somewhat overengineered
|
18
|
-
|
19
|
-
* speed of updates is limited by the client>server>MQTT>server>client
|
20
|
-
chain; two possibly-high-load servers in between cause too much delay
|
21
|
-
|
22
|
-
* Messages tended to be more verbose than necessary
|
23
|
-
|
24
|
-
++++++++++++++++++
|
25
|
-
V3 design overview
|
26
|
-
++++++++++++++++++
|
27
|
-
|
28
|
-
Server start
|
29
|
-
++++++++++++
|
30
|
-
|
31
|
-
* connect to MQTT, listen to all MoaT messages,
|
32
|
-
update internal state as messages come in
|
33
|
-
|
34
|
-
* ask for a server link on the Join/Actor topic
|
35
|
-
|
36
|
-
* load the local backup if present
|
37
|
-
|
38
|
-
* fetch full tree from designated server is replied
|
39
|
-
|
40
|
-
* merge data
|
41
|
-
|
42
|
-
* Join actor topic
|
43
|
-
|
44
|
-
|
45
|
-
Client connection setup A
|
46
|
-
+++++++++++++++++++++++++
|
47
|
-
|
48
|
-
* Client connects to MQTT and sends Query message
|
49
|
-
* Designated server replies with connection data
|
50
|
-
* Client connects to server
|
51
|
-
|
52
|
-
* Server greets client
|
53
|
-
* Client authenticates
|
54
|
-
* Server sends MQTT connection information
|
55
|
-
* Client connects to MQTT and sends Birth message
|
56
|
-
* Server sees the client's message and sends ACK to the client
|
57
|
-
|
58
|
-
Client connection setup B
|
59
|
-
+++++++++++++++++++++++++
|
60
|
-
|
61
|
-
This method is slower; it can be used when the configured server doesn't work.
|
62
|
-
|
63
|
-
* Client connects to MQTT and sends Query message
|
64
|
-
* Designated server sends connection data
|
65
|
-
|
66
|
-
Reading initial data
|
67
|
-
++++++++++++++++++++
|
68
|
-
|
69
|
-
* Client subscribes to MQTT topic
|
70
|
-
* Client requests initial data from server
|
71
|
-
* Server sends data, advises client that no data exist, or tells the client
|
72
|
-
that MQTT uses retaining (if so, which codec to use)
|
73
|
-
|
74
|
-
Updates
|
75
|
-
+++++++
|
76
|
-
|
77
|
-
The most notable pain point of the old design is the speed of updates.
|
78
|
-
Thus in V3 all updates will be MQTT messages.
|
79
|
-
|
80
|
-
This section does not apply if the MQTT server retains the data.
|
81
|
-
|
82
|
-
MoaT update messages are CBOR maps. Keys are small integers for message brevity and
|
83
|
-
decode speed.
|
84
|
-
|
85
|
-
* 0: tock
|
86
|
-
|
87
|
-
The system-wide update counter. May be missing.
|
88
|
-
|
89
|
-
* 1: value
|
90
|
-
|
91
|
-
Contents: Whatever is CBOR-encodeable. A missing value means that the
|
92
|
-
object shall be deleted.
|
93
|
-
|
94
|
-
* 2: tick.
|
95
|
-
|
96
|
-
Update tracker. This is a ``((name, seq, counter), …)`` list of tuples.
|
97
|
-
|
98
|
-
* name
|
99
|
-
The server's name
|
100
|
-
|
101
|
-
* seq
|
102
|
-
Client connection. Zero is reserved for server-generated content.
|
103
|
-
|
104
|
-
* counter
|
105
|
-
A per-client update counter, managed by the client. Must start at 1 and
|
106
|
-
increment in steps of 1, in order to detect skipped updates.
|
107
|
-
|
108
|
-
|
109
|
-
The server sees the update and sends an ACK message to the client, assuming
|
110
|
-
that there was no conflict.
|
111
|
-
|
112
|
-
|
113
|
-
Skipped updates
|
114
|
-
+++++++++++++++
|
115
|
-
|
116
|
-
Servers listen to all messages. If there's a gap in a client's sequence
|
117
|
-
numbers, the server will ask it to repeat the message.
|
118
|
-
|
119
|
-
|
120
|
-
Update conflict resolution
|
121
|
-
++++++++++++++++++++++++++
|
122
|
-
|
123
|
-
If a client sends a message which the server determines
|
124
|
-
|
125
|
-
|
126
|
-
MQTT topics
|
127
|
-
+++++++++++
|
128
|
-
|
129
|
-
All are under a common configured prefix, the default is "moat/main".
|
130
|
-
|
131
|
-
svc/act
|
132
|
-
-------
|
133
|
-
|
134
|
-
The Actor topic for server identification.
|
135
|
-
|
136
|
-
The transmitted value contains the server's name, host and port.
|
137
|
-
|
138
|
-
|
139
|
-
svc/query
|
140
|
-
---------
|
141
|
-
|
142
|
-
Connect requests from clients.
|
143
|
-
|
144
|
-
svc/server
|
145
|
-
----------
|
146
|
-
|
147
|
-
Reply queue for messages to ``svc/query``. Contains the server value as
|
148
|
-
above.
|
149
|
-
|
150
|
-
|
151
|
-
d/*
|
152
|
-
---
|
153
|
-
|
154
|
-
Update messages.
|
155
|
-
|
156
|
-
Topic translation
|
157
|
-
+++++++++++++++++
|
158
|
-
|
159
|
-
Topics are encoded like MoaT paths, except for these differences:
|
160
|
-
|
161
|
-
* The path separator is ``/`` instead of ``.``
|
162
|
-
* Slashes are escaped as ``:_``.
|
163
|
-
* Spaces in paths are never escaped: that would collide with the previous rule
|
164
|
-
* Dots are not escaped, obviously.
|
165
|
-
* `None` is encoded as "$NULL" when it's a top-level element.
|
166
|
-
* The sequence ``:.`` is used to shield both wildcards and strings with a
|
167
|
-
leading ``$`` character. It translates back to an empty string, not a
|
168
|
-
dot, and may be treated as an illegal sequence otherwise.
|
@@ -1,21 +0,0 @@
|
|
1
|
-
code: |
|
2
|
-
await _self.watch(src, fetch=False)
|
3
|
-
async for msg in _info:
|
4
|
-
if isinstance(msg, _cls.ChangeMsg):
|
5
|
-
try:
|
6
|
-
val = msg.value * factor + offset
|
7
|
-
except AttributeError:
|
8
|
-
continue
|
9
|
-
await _client.set(dst, value=val, idem=False)
|
10
|
-
info: Apply factor+offset
|
11
|
-
is_async: true
|
12
|
-
vars:
|
13
|
-
- src
|
14
|
-
- dst
|
15
|
-
- factor
|
16
|
-
- offset
|
17
|
-
|
18
|
-
# Whenever the value at 'src', changes, this code multiplies it by
|
19
|
-
# 'factor', adds 'offset', and writes it to 'dst'.
|
20
|
-
#
|
21
|
-
# This takes ~0.025 seconds, end-to-end, on a Raspberry Pi 3.
|
@@ -1,82 +0,0 @@
|
|
1
|
-
code: |
|
2
|
-
await _self.watch(src, fetch=False)
|
3
|
-
inv = high < low
|
4
|
-
if inv:
|
5
|
-
high,low = low,high
|
6
|
-
res = await _client.get(flip)
|
7
|
-
if "value" in res:
|
8
|
-
is_high = res.value != inv
|
9
|
-
else:
|
10
|
-
await _client.set(flip, value=inv)
|
11
|
-
is_high = False
|
12
|
-
|
13
|
-
async for msg in _info:
|
14
|
-
if isinstance(msg, _cls.ChangeMsg):
|
15
|
-
try:
|
16
|
-
val = msg.value
|
17
|
-
except AttributeError:
|
18
|
-
continue
|
19
|
-
if is_high and val < low:
|
20
|
-
is_high = False
|
21
|
-
await _client.set(flip, value=inv)
|
22
|
-
elif not is_high and val > high:
|
23
|
-
is_high = True
|
24
|
-
await _client.set(flip, value=not inv)
|
25
|
-
else:
|
26
|
-
if is_high:
|
27
|
-
val += high-low
|
28
|
-
await _client.set(dst, value=val)
|
29
|
-
info: Switch input between triggers
|
30
|
-
is_async: true
|
31
|
-
vars:
|
32
|
-
- src
|
33
|
-
- dst
|
34
|
-
- flip
|
35
|
-
- high
|
36
|
-
- low
|
37
|
-
|
38
|
-
# Consider this simple hook-up of a photoresistor:
|
39
|
-
#
|
40
|
-
# +5V --- PHOTO --+-- R1 --+-- R2 --- GND
|
41
|
-
# | |
|
42
|
-
# sensor port
|
43
|
-
#
|
44
|
-
# The port is a pull-down output: thus, this setup switches resistance
|
45
|
-
# between R1 and R1+R2, which allows us to measure the wide range of
|
46
|
-
# resistance which a typical photoresistor has, without requiring more
|
47
|
-
# fancy circuitry.
|
48
|
-
# ‹low› and ‹high› need to be calculated so that
|
49
|
-
#
|
50
|
-
# * when the photoresistor's resistance is such that the voltage at the
|
51
|
-
# sensor is at ‹high›, switching on the port will set the voltage to
|
52
|
-
# ‹low›, so you don't get a break in the brightness curve
|
53
|
-
# * the rate of change is roughly equal, so you don't get a kink in that
|
54
|
-
# curve.
|
55
|
-
#
|
56
|
-
# These conditions are satisfied when R(photo) = √(R1*(R1+R2)).
|
57
|
-
# So if R1=100Ω and R2=10kΩ, R(photo) at the switching point would be 1005Ω,
|
58
|
-
# thus you can calculate V(high) as 4.55 Volt and V(low) as 0.45 Volt.
|
59
|
-
#
|
60
|
-
# The actual choice of resistors is up to you and depends on the
|
61
|
-
# photoresistor's behavior in "interesting" lighting conditions. In general
|
62
|
-
# you'd want a high-resolution capture of the values at both ends of the
|
63
|
-
# range. Thus the above resistor values are sensible if the photoresistor
|
64
|
-
# is at 5kΩ when the light gets bright enough to read the newspaper (you
|
65
|
-
# want to capture as many nuances of the dark phase as possible), and at
|
66
|
-
# 50Ω on a bright summer day just as a cloud has obscured the sun.
|
67
|
-
# Or something like that.
|
68
|
-
#
|
69
|
-
# 'src' is the path which the sensor value is written to. Presumably it's
|
70
|
-
# polled periodically.
|
71
|
-
#
|
72
|
-
# 'dst' is the entry which receives the adjusted value.
|
73
|
-
#
|
74
|
-
# 'flip' is the entry which corresponds to the port. It receives a `bool`
|
75
|
-
# value (`False` on startup).
|
76
|
-
#
|
77
|
-
# 'low' and 'high' are the threshold values. If 'low' is greater than
|
78
|
-
# 'high', the port is inverted (i.e. it's set to `True` on startup).
|
79
|
-
#
|
80
|
-
# When a ‹src› update causes the port to be inverted, writing to ‹dst› is
|
81
|
-
# skipped: if the new value is close to the threshold, the delay doesn't
|
82
|
-
# matter much, and if it's not the value would be too inaccurate.
|
@@ -1,63 +0,0 @@
|
|
1
|
-
code: |
|
2
|
-
last_val = None
|
3
|
-
this_val = None
|
4
|
-
timer = None
|
5
|
-
await _client.set(dst, value=0, idem=True)
|
6
|
-
await _self.watch(src, fetch=True)
|
7
|
-
|
8
|
-
async for msg in _info:
|
9
|
-
if isinstance(msg, _cls.ChangeMsg):
|
10
|
-
try:
|
11
|
-
val = msg.value
|
12
|
-
except AttributeError:
|
13
|
-
continue
|
14
|
-
if last_val is None:
|
15
|
-
last_val = val
|
16
|
-
this_val = val
|
17
|
-
continue
|
18
|
-
this_val = val
|
19
|
-
delta = this_val - last_val
|
20
|
-
if delta > 0 and timer is None:
|
21
|
-
# fire an immediate update at first change
|
22
|
-
await _client.set(dst, value=delta*factor, idem=(delta == 0))
|
23
|
-
timer = await _self.timer(seconds)
|
24
|
-
elif delta < 0:
|
25
|
-
# wraparound or whatever
|
26
|
-
last_val = this_val
|
27
|
-
if timer is not None:
|
28
|
-
await timer.cancel()
|
29
|
-
timer = None
|
30
|
-
elif isinstance(msg, _cls.TimerMsg):
|
31
|
-
delta = this_val - last_val
|
32
|
-
if delta >= 0:
|
33
|
-
await _client.set(dst, value=delta*factor, idem=(delta == 0))
|
34
|
-
if delta > 0:
|
35
|
-
await timer.run(seconds)
|
36
|
-
else:
|
37
|
-
timer = None
|
38
|
-
last_val = this_val
|
39
|
-
info: generate timeslots for counter deltas
|
40
|
-
is_async: true
|
41
|
-
vars:
|
42
|
-
- src
|
43
|
-
- dst
|
44
|
-
- seconds
|
45
|
-
- factor
|
46
|
-
|
47
|
-
# This code converts a randomly-updating counter into one that carries a
|
48
|
-
# defined meaning.
|
49
|
-
#
|
50
|
-
# Consider a rain meter. The counter triggers whenever the meter's counter
|
51
|
-
# triggers possibly aggregated so that you don't get more than one update
|
52
|
-
# every ten seconds even if it's raining buckets.
|
53
|
-
#
|
54
|
-
# However, in your display you want the rate of rain over, say, the last
|
55
|
-
# minute, so you can show some approximation of "how much rain is there
|
56
|
-
# right now".
|
57
|
-
#
|
58
|
-
# This code sends an initial update immediately so that receiving code sees
|
59
|
-
# some value > 0 ASAP, then another update every ‹seconds›.
|
60
|
-
#
|
61
|
-
# Updates are scaled by ‹factor› so you can translate the counter's output
|
62
|
-
# to something understandable like "how many mm of water would there be on
|
63
|
-
# the ground if this amount of rain continued for an hour".
|
examples/pathify.py
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
#!/usr/bin/python3
|
2
|
-
|
3
|
-
# Batch-convert data. In this case I had some entries which were stored as
|
4
|
-
# a list, but using Path made much more sense (esp when you need to
|
5
|
-
# view/edit the yaml export).
|
6
|
-
|
7
|
-
import anyio
|
8
|
-
from moat.kv.client import open_client
|
9
|
-
from moat.util import P, yload, Path
|
10
|
-
import asyncclick as click
|
11
|
-
|
12
|
-
|
13
|
-
def conv(m, s: str) -> bool:
|
14
|
-
try:
|
15
|
-
d = m.value[s]
|
16
|
-
except KeyError:
|
17
|
-
return 0
|
18
|
-
if isinstance(d, Path):
|
19
|
-
return 0
|
20
|
-
if not isinstance(d, Sequence):
|
21
|
-
return 0
|
22
|
-
d = Path.build(d)
|
23
|
-
m.value[s] = d
|
24
|
-
return 1
|
25
|
-
|
26
|
-
|
27
|
-
@click.command()
|
28
|
-
@click.argument("path", type=P)
|
29
|
-
@click.argument("keys", type=str, nargs=-1)
|
30
|
-
async def main(path, keys):
|
31
|
-
if not keys:
|
32
|
-
keys = "src dest dst state".split()
|
33
|
-
with open("/etc/moat.kv.cfg") as cff:
|
34
|
-
cfg = yload(cff)
|
35
|
-
async with open_client(**cfg) as client:
|
36
|
-
async for m in client.get_tree(path, nchain=2):
|
37
|
-
n = 0
|
38
|
-
for k in keys:
|
39
|
-
n += conv(m, k)
|
40
|
-
if n:
|
41
|
-
await client.set(ORIG + m.path, value=m.value, chain=m.chain)
|
42
|
-
|
43
|
-
|
44
|
-
if __name__ == "__main__":
|
45
|
-
main()
|
moat/kv/codec.py
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
This module contains helper functions for packing+unpacking of single messages,
|
3
|
-
plus an unpacker factory for streams.
|
4
|
-
"""
|
5
|
-
|
6
|
-
# compatibility
|
7
|
-
from __future__ import annotations
|
8
|
-
|
9
|
-
from moat.util import * # noqa: F403
|
10
|
-
|
11
|
-
__all__ = ["packer", "unpacker", "stream_unpacker"] # noqa: F405
|
moat_kv-0.71.0.dist-info/RECORD
DELETED
@@ -1,188 +0,0 @@
|
|
1
|
-
build/lib/docs/source/conf.py,sha256=v4cO_xK-WpfHeOCQ4RaeHFk8vwBM7Gg3sw6DgGLmpCc,6072
|
2
|
-
build/lib/examples/pathify.py,sha256=cq2j7Nqhl3jmoNZ6l8wMj4j7DkHMxyB7-oTOrCZA0xQ,1128
|
3
|
-
build/lib/moat/kv/__init__.py,sha256=TO2TyH5Focv78vDDqtiN1vZVLsVihrOqvHBAlLIgVRA,508
|
4
|
-
build/lib/moat/kv/_cfg.yaml,sha256=HMyyiInthAOme_j9ydpfMzSvWVn_wgpNFAFyhpOCsuo,2153
|
5
|
-
build/lib/moat/kv/_main.py,sha256=SgI4ef8AQDOC4N4pLRiyaiSiFIzN-J337WIcuC7DPOY,2234
|
6
|
-
build/lib/moat/kv/client.py,sha256=c8YV0sjpO2XYpNE-fep7fDO2kgsNdShZxgCjohy23CY,34549
|
7
|
-
build/lib/moat/kv/code.py,sha256=gM7WNsjCfukr7h2fKm1U3zMHN5Wj-_hgy5U817LP9qE,6427
|
8
|
-
build/lib/moat/kv/codec.py,sha256=1AUNYxCOUJSZfZlny-asNZ0gmz0eaPmQKjr3biNDhWM,284
|
9
|
-
build/lib/moat/kv/config.py,sha256=cWJ1m8PRwzzapsin1XSDjRtYJCgNN6g7gA9q48luDV8,1093
|
10
|
-
build/lib/moat/kv/data.py,sha256=oiSGHnrrmJOkxC71bQj1ZsmBsVpE_vPT83IqRuHaNls,5992
|
11
|
-
build/lib/moat/kv/errors.py,sha256=wmi2OVsO4IeedScGTTFWvECkHLHMRiukoWXLpjI4-Us,16742
|
12
|
-
build/lib/moat/kv/exceptions.py,sha256=4gRsYa6kuBy1qFYiBUYElup_cvOe7QgPQtryHAYphzo,1849
|
13
|
-
build/lib/moat/kv/model.py,sha256=il8TjxrvL3EJKTZ88IDx2pJXcaKbXUSwsOIV4lXsW9Q,33390
|
14
|
-
build/lib/moat/kv/runner.py,sha256=eDXsNFWKidx5HLmP2MGpgRdeTeoL7dCSXLA_BKy55uE,41889
|
15
|
-
build/lib/moat/kv/server.py,sha256=O-yJiJYT5sQPeku9iTRo-SXqkHBq7OhKpHSA5IbKtvM,94918
|
16
|
-
build/lib/moat/kv/types.py,sha256=6klFuDHtbhRxrpLOYn1tnDndoRwE0nrolz3tFKOWtd8,14056
|
17
|
-
build/lib/moat/kv/actor/__init__.py,sha256=EdDaj0xXvL9QIecooWg3AfPyCHjdCCtKzXmtPRA7pkE,2134
|
18
|
-
build/lib/moat/kv/actor/deletor.py,sha256=v33XsCaemmaxZHRZP6JWap1yV9k7WkK6smPB-mwHyZA,4481
|
19
|
-
build/lib/moat/kv/auth/__init__.py,sha256=xd-nO76LTGeo7ppCqqv2aOc6nhzzyyRXmYKT4x3_I88,12490
|
20
|
-
build/lib/moat/kv/auth/_test.py,sha256=ZaMpMf2CTJ6sdGyENUhdWAY5TLC-kBtszM3dFQbyuWA,4342
|
21
|
-
build/lib/moat/kv/auth/password.py,sha256=DQG2BnNEoQ0H-znkHJx0G9-bcdWwg3IgqojcAHhKIsQ,6307
|
22
|
-
build/lib/moat/kv/auth/root.py,sha256=lW-_hgQp3ZIzAAe4iBl0rdMU-pFuHIC6ObA3rdFXxkk,1303
|
23
|
-
build/lib/moat/kv/backend/__init__.py,sha256=f5nIOWD2zml2YiaBNXtEOzC7SEGgwDFJMB8YzRISJ0A,1689
|
24
|
-
build/lib/moat/kv/backend/mqtt.py,sha256=XUwMR8RPzq6EPLub0cy7YzXTS1CkfBZFtZ4W9GTcQBo,2007
|
25
|
-
build/lib/moat/kv/command/__init__.py,sha256=9_8wL9Scv8_Cs8HJyJHGvx1vwXErsuvlsAqNZLcJQR0,8
|
26
|
-
build/lib/moat/kv/command/acl.py,sha256=wSdlzKBjWIFX3IxCdLcG3ZqjvtX8KPtqe38ibyU2VDo,4665
|
27
|
-
build/lib/moat/kv/command/auth.py,sha256=vP22ZIBMjRdUxN4_ELKiDgIE5ZqdMxs1ky1WDVUx50M,7149
|
28
|
-
build/lib/moat/kv/command/code.py,sha256=ycGBoKBB0Gse3Tt9h9WvgiIZVe3Yg-x92RRjfCCCXVQ,8066
|
29
|
-
build/lib/moat/kv/command/codec.py,sha256=8GqOl-oxWFM2D1Fm9Iheot2AmS_SsOYfqfbbde3qvQY,6028
|
30
|
-
build/lib/moat/kv/command/data.py,sha256=ntT6CQkmXtyFMgJNm9WMn23kVP5MR73q53w2WASsoOg,8396
|
31
|
-
build/lib/moat/kv/command/error.py,sha256=XqHmVJgBGjr6XOozi23wEjiTqPopD1CzkIeR1a3Z_vY,4350
|
32
|
-
build/lib/moat/kv/command/internal.py,sha256=wjEHTltUXIMEiXriyd5DuTDlaI_2W2uaJIi-dNLT_OA,7397
|
33
|
-
build/lib/moat/kv/command/job.py,sha256=C2qH7ghQcPL5vj-Pg0YZ2i2Rvg5kpzH58EqBTCaK1Tw,13614
|
34
|
-
build/lib/moat/kv/command/log.py,sha256=ycdtMgiBw2DaCu0yu6tpWKPLlQ33ZZemXsfwZrCzRGg,1350
|
35
|
-
build/lib/moat/kv/command/server.py,sha256=Hl_6FFq322c5KjJCKxH1nCrxo-h0VEwH4IOMbVeUBN4,3392
|
36
|
-
build/lib/moat/kv/command/type.py,sha256=JN0_Abb5wR4UJH5zHnVZgT93NJRYY6qpRD_ZQT13u4k,6226
|
37
|
-
build/lib/moat/kv/command/dump/__init__.py,sha256=L05R6W9eDzUDAr7UhfEo1lZR-UB0qYUUf-5dRHC-p-0,4000
|
38
|
-
build/lib/moat/kv/mock/__init__.py,sha256=HW6YAwo_OBVRmTeRCc-ZoUHB7-D78cEONlcb5vACdIE,2760
|
39
|
-
build/lib/moat/kv/mock/mqtt.py,sha256=b9pzbwQBmTX2eSiSgNO7nh2-7l8-0TT8n2GxinQ-1l0,5213
|
40
|
-
build/lib/moat/kv/mock/tracer.py,sha256=qLEIn9gdlYUypyRYD8O8SbM8ye8XR4xtBl3otP6uNLs,2058
|
41
|
-
build/lib/moat/kv/obj/__init__.py,sha256=yeiZ6bWM8XhK28ruqX7RmpPhytYXlOJPRw_hsWbvExk,19800
|
42
|
-
build/lib/moat/kv/obj/command.py,sha256=QQiOhPtlGV07kuutV0KowmC2HiXhmIFUktofqlRg1GA,7446
|
43
|
-
ci/rtd-requirements.txt,sha256=q_4dVDUIuXYxY3nN9_NCKYUiBpktQFouyqfmCANc1W4,123
|
44
|
-
ci/test-requirements.txt,sha256=ABIHUDbtJ3hpVgItYyHuFbh9UKuRMYmkILROxc1ygmk,74
|
45
|
-
ci/travis.sh,sha256=CZiQZUebAmYYH3DUOArik0ktJCG8Q0DE7lb0D-porDo,3335
|
46
|
-
debian/.gitignore,sha256=hecgAHAGCwd3DkI44GQT08cmd8DaCcz-zOQuINQ7ZKs,97
|
47
|
-
debian/changelog,sha256=lcGqGWXCsqfuc6LC02cFdiK7c9RD4p9tNMSqOttB81s,32353
|
48
|
-
debian/control,sha256=a5aeNf2U0O9kAZjh28-g0-HuJsYksxPWTgVNZ5kW2VY,1441
|
49
|
-
debian/moat-kv.postinst,sha256=2z322zcHXXTX0lXcOUn9DBnVPNO4f_d8nsfxuhNpfHY,33
|
50
|
-
debian/rules,sha256=bOC4tJvuLUgFaQmBu_zxcjtJGn01HkZKhctnDoqT6WY,461
|
51
|
-
debian/watch,sha256=O8zhQHur_qoHyzVIewbea-dfUSkJmCmV7P6PzZFPkR4,191
|
52
|
-
debian/moat-kv/usr/lib/python3/dist-packages/docs/source/conf.py,sha256=v4cO_xK-WpfHeOCQ4RaeHFk8vwBM7Gg3sw6DgGLmpCc,6072
|
53
|
-
debian/moat-kv/usr/lib/python3/dist-packages/examples/pathify.py,sha256=cq2j7Nqhl3jmoNZ6l8wMj4j7DkHMxyB7-oTOrCZA0xQ,1128
|
54
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/__init__.py,sha256=TO2TyH5Focv78vDDqtiN1vZVLsVihrOqvHBAlLIgVRA,508
|
55
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/_cfg.yaml,sha256=HMyyiInthAOme_j9ydpfMzSvWVn_wgpNFAFyhpOCsuo,2153
|
56
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/_main.py,sha256=SgI4ef8AQDOC4N4pLRiyaiSiFIzN-J337WIcuC7DPOY,2234
|
57
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/client.py,sha256=c8YV0sjpO2XYpNE-fep7fDO2kgsNdShZxgCjohy23CY,34549
|
58
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/code.py,sha256=gM7WNsjCfukr7h2fKm1U3zMHN5Wj-_hgy5U817LP9qE,6427
|
59
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/codec.py,sha256=1AUNYxCOUJSZfZlny-asNZ0gmz0eaPmQKjr3biNDhWM,284
|
60
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/config.py,sha256=cWJ1m8PRwzzapsin1XSDjRtYJCgNN6g7gA9q48luDV8,1093
|
61
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/data.py,sha256=oiSGHnrrmJOkxC71bQj1ZsmBsVpE_vPT83IqRuHaNls,5992
|
62
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/errors.py,sha256=wmi2OVsO4IeedScGTTFWvECkHLHMRiukoWXLpjI4-Us,16742
|
63
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/exceptions.py,sha256=4gRsYa6kuBy1qFYiBUYElup_cvOe7QgPQtryHAYphzo,1849
|
64
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/model.py,sha256=il8TjxrvL3EJKTZ88IDx2pJXcaKbXUSwsOIV4lXsW9Q,33390
|
65
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/runner.py,sha256=eDXsNFWKidx5HLmP2MGpgRdeTeoL7dCSXLA_BKy55uE,41889
|
66
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/server.py,sha256=O-yJiJYT5sQPeku9iTRo-SXqkHBq7OhKpHSA5IbKtvM,94918
|
67
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/types.py,sha256=6klFuDHtbhRxrpLOYn1tnDndoRwE0nrolz3tFKOWtd8,14056
|
68
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/actor/__init__.py,sha256=EdDaj0xXvL9QIecooWg3AfPyCHjdCCtKzXmtPRA7pkE,2134
|
69
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/actor/deletor.py,sha256=v33XsCaemmaxZHRZP6JWap1yV9k7WkK6smPB-mwHyZA,4481
|
70
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/__init__.py,sha256=xd-nO76LTGeo7ppCqqv2aOc6nhzzyyRXmYKT4x3_I88,12490
|
71
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/_test.py,sha256=ZaMpMf2CTJ6sdGyENUhdWAY5TLC-kBtszM3dFQbyuWA,4342
|
72
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/password.py,sha256=DQG2BnNEoQ0H-znkHJx0G9-bcdWwg3IgqojcAHhKIsQ,6307
|
73
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/auth/root.py,sha256=lW-_hgQp3ZIzAAe4iBl0rdMU-pFuHIC6ObA3rdFXxkk,1303
|
74
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/backend/__init__.py,sha256=f5nIOWD2zml2YiaBNXtEOzC7SEGgwDFJMB8YzRISJ0A,1689
|
75
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/backend/mqtt.py,sha256=XUwMR8RPzq6EPLub0cy7YzXTS1CkfBZFtZ4W9GTcQBo,2007
|
76
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/__init__.py,sha256=9_8wL9Scv8_Cs8HJyJHGvx1vwXErsuvlsAqNZLcJQR0,8
|
77
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/acl.py,sha256=wSdlzKBjWIFX3IxCdLcG3ZqjvtX8KPtqe38ibyU2VDo,4665
|
78
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/auth.py,sha256=vP22ZIBMjRdUxN4_ELKiDgIE5ZqdMxs1ky1WDVUx50M,7149
|
79
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/code.py,sha256=ycGBoKBB0Gse3Tt9h9WvgiIZVe3Yg-x92RRjfCCCXVQ,8066
|
80
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/codec.py,sha256=8GqOl-oxWFM2D1Fm9Iheot2AmS_SsOYfqfbbde3qvQY,6028
|
81
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/data.py,sha256=ntT6CQkmXtyFMgJNm9WMn23kVP5MR73q53w2WASsoOg,8396
|
82
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/error.py,sha256=XqHmVJgBGjr6XOozi23wEjiTqPopD1CzkIeR1a3Z_vY,4350
|
83
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/internal.py,sha256=wjEHTltUXIMEiXriyd5DuTDlaI_2W2uaJIi-dNLT_OA,7397
|
84
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/job.py,sha256=C2qH7ghQcPL5vj-Pg0YZ2i2Rvg5kpzH58EqBTCaK1Tw,13614
|
85
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/log.py,sha256=ycdtMgiBw2DaCu0yu6tpWKPLlQ33ZZemXsfwZrCzRGg,1350
|
86
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/server.py,sha256=Hl_6FFq322c5KjJCKxH1nCrxo-h0VEwH4IOMbVeUBN4,3392
|
87
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/type.py,sha256=JN0_Abb5wR4UJH5zHnVZgT93NJRYY6qpRD_ZQT13u4k,6226
|
88
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/command/dump/__init__.py,sha256=L05R6W9eDzUDAr7UhfEo1lZR-UB0qYUUf-5dRHC-p-0,4000
|
89
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/mock/__init__.py,sha256=HW6YAwo_OBVRmTeRCc-ZoUHB7-D78cEONlcb5vACdIE,2760
|
90
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/mock/mqtt.py,sha256=b9pzbwQBmTX2eSiSgNO7nh2-7l8-0TT8n2GxinQ-1l0,5213
|
91
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/mock/tracer.py,sha256=qLEIn9gdlYUypyRYD8O8SbM8ye8XR4xtBl3otP6uNLs,2058
|
92
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/obj/__init__.py,sha256=yeiZ6bWM8XhK28ruqX7RmpPhytYXlOJPRw_hsWbvExk,19800
|
93
|
-
debian/moat-kv/usr/lib/python3/dist-packages/moat/kv/obj/command.py,sha256=QQiOhPtlGV07kuutV0KowmC2HiXhmIFUktofqlRg1GA,7446
|
94
|
-
debian/source/format,sha256=G-cIDXLmtWbfPiNs4sVe_fu7j6HJctgl5bZy_4dzvho,12
|
95
|
-
docs/Makefile,sha256=g6jq_WYItszUyPzdvzs04ZgPOGXE_THsm2zAbvVUMnU,609
|
96
|
-
docs/make.bat,sha256=tZwnc3a-ozijIP3JTHDoSdNFMwXwrELNhOCFMBxB7K0,779
|
97
|
-
docs/source/TODO.rst,sha256=87ZE4VAEzSgYXr2BvUCnMFYa1TSNAr3nPiZNt0b6B5Y,1921
|
98
|
-
docs/source/acls.rst,sha256=qAG7SrTnBJv2IIS36FC74ubt0FJQ5rZBwd8yXuYQZd0,2018
|
99
|
-
docs/source/auth.rst,sha256=9-4se2vH-kbB86BiUMfafTXNtmHrPHH9nZDujRxw0ww,2603
|
100
|
-
docs/source/client_protocol.rst,sha256=X_EMTbWRXBotwAPDRCDeZUEBaK2OXul8t_PV0BiC1Gs,14094
|
101
|
-
docs/source/code.rst,sha256=ihHRtzpeEWGhioCUssakSrbkB7V2heA0Qca4RKcAv00,10371
|
102
|
-
docs/source/command_line.rst,sha256=jBK1-5Kc_ySTiIhVNK7W2Ffdf21MszCLFo3Z_aC04Kw,29241
|
103
|
-
docs/source/common_protocol.rst,sha256=8TT3OMZc0nX8wRSMg6gQk88OwQ2TekWTjcJVK4ymdfc,1281
|
104
|
-
docs/source/conf.py,sha256=v4cO_xK-WpfHeOCQ4RaeHFk8vwBM7Gg3sw6DgGLmpCc,6072
|
105
|
-
docs/source/debugging.rst,sha256=1wZIQGsHjMoLCKAK0TPlvAtxqMU4UyvHa6tUhXN4_eE,2188
|
106
|
-
docs/source/extend.rst,sha256=UjLPvKaod14mEbi20r2Qtx2ROZmsu2cWRAENMfFhlD4,1402
|
107
|
-
docs/source/history.rst,sha256=ba0qchAJyGI0exigWDrhYT26KfxjIYEnf8hFcr_XKJ8,868
|
108
|
-
docs/source/index.rst,sha256=8-oMWmXV6aXzUT6JK-ghYZMphDu98srReAVkj4IV3jU,1866
|
109
|
-
docs/source/model.rst,sha256=8yZfsmoOikxDw-0d82ArPg3MP-XzLWou0lfw8Ry8C0Q,1622
|
110
|
-
docs/source/overview.rst,sha256=-PdRj09LBJP-in5zWMO66OXTCu04tZvuReyeOlHP64c,3409
|
111
|
-
docs/source/related.rst,sha256=CvlTLgsnnha3646NMhH7Kg9KW1WZr0xQistU903C9Gc,2749
|
112
|
-
docs/source/server_protocol.rst,sha256=l9uG0yKOSmr9X7JuokWYbOauGUyp-FZYnbP73UTHNgk,16180
|
113
|
-
docs/source/startup.rst,sha256=vx2_zvNrKHiRaYK5GIfzzJ1SmtMtVJ8yXJHfRhfxWuI,1085
|
114
|
-
docs/source/translator.rst,sha256=b1x0H_8E9abPEA-dBk656wWQpnioGpNmJKfbZz1XnnU,7513
|
115
|
-
docs/source/tutorial.rst,sha256=uoAZR44f6734Y7N9TYLai6-SEF0iPZRfJ8iXHn0yeKA,22429
|
116
|
-
docs/source/v3.rst,sha256=EQf1i4LJe7cSyWCgi_gLYAJjBmeF1KJ5yaKRzpB5psc,3960
|
117
|
-
docs/source/_static/.gitkeep,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
118
|
-
examples/pathify.py,sha256=cq2j7Nqhl3jmoNZ6l8wMj4j7DkHMxyB7-oTOrCZA0xQ,1128
|
119
|
-
examples/code/transform.scale.yml,sha256=aim0aTXvbrGfkNsZ6WM5JUHTXfZdGCvKPGhq-8O9IQo,550
|
120
|
-
examples/code/transform.switch.yml,sha256=NUoO3241TtL-L-orMR0a3i2I0ZJLpgbz_TVXT07NocE,3033
|
121
|
-
examples/code/transform.timeslot.yml,sha256=9SSOEE77rT2iveH0UZLrmv9VeUJkAgb5k5bGV5C8WAk,2142
|
122
|
-
moat/kv/__init__.py,sha256=TO2TyH5Focv78vDDqtiN1vZVLsVihrOqvHBAlLIgVRA,508
|
123
|
-
moat/kv/_cfg.yaml,sha256=HMyyiInthAOme_j9ydpfMzSvWVn_wgpNFAFyhpOCsuo,2153
|
124
|
-
moat/kv/_main.py,sha256=SgI4ef8AQDOC4N4pLRiyaiSiFIzN-J337WIcuC7DPOY,2234
|
125
|
-
moat/kv/client.py,sha256=c8YV0sjpO2XYpNE-fep7fDO2kgsNdShZxgCjohy23CY,34549
|
126
|
-
moat/kv/code.py,sha256=gM7WNsjCfukr7h2fKm1U3zMHN5Wj-_hgy5U817LP9qE,6427
|
127
|
-
moat/kv/codec.py,sha256=1AUNYxCOUJSZfZlny-asNZ0gmz0eaPmQKjr3biNDhWM,284
|
128
|
-
moat/kv/config.py,sha256=cWJ1m8PRwzzapsin1XSDjRtYJCgNN6g7gA9q48luDV8,1093
|
129
|
-
moat/kv/data.py,sha256=oiSGHnrrmJOkxC71bQj1ZsmBsVpE_vPT83IqRuHaNls,5992
|
130
|
-
moat/kv/errors.py,sha256=wmi2OVsO4IeedScGTTFWvECkHLHMRiukoWXLpjI4-Us,16742
|
131
|
-
moat/kv/exceptions.py,sha256=4gRsYa6kuBy1qFYiBUYElup_cvOe7QgPQtryHAYphzo,1849
|
132
|
-
moat/kv/model.py,sha256=il8TjxrvL3EJKTZ88IDx2pJXcaKbXUSwsOIV4lXsW9Q,33390
|
133
|
-
moat/kv/runner.py,sha256=eDXsNFWKidx5HLmP2MGpgRdeTeoL7dCSXLA_BKy55uE,41889
|
134
|
-
moat/kv/server.py,sha256=O-yJiJYT5sQPeku9iTRo-SXqkHBq7OhKpHSA5IbKtvM,94918
|
135
|
-
moat/kv/types.py,sha256=6klFuDHtbhRxrpLOYn1tnDndoRwE0nrolz3tFKOWtd8,14056
|
136
|
-
moat/kv/actor/__init__.py,sha256=EdDaj0xXvL9QIecooWg3AfPyCHjdCCtKzXmtPRA7pkE,2134
|
137
|
-
moat/kv/actor/deletor.py,sha256=v33XsCaemmaxZHRZP6JWap1yV9k7WkK6smPB-mwHyZA,4481
|
138
|
-
moat/kv/auth/__init__.py,sha256=xd-nO76LTGeo7ppCqqv2aOc6nhzzyyRXmYKT4x3_I88,12490
|
139
|
-
moat/kv/auth/_test.py,sha256=ZaMpMf2CTJ6sdGyENUhdWAY5TLC-kBtszM3dFQbyuWA,4342
|
140
|
-
moat/kv/auth/password.py,sha256=DQG2BnNEoQ0H-znkHJx0G9-bcdWwg3IgqojcAHhKIsQ,6307
|
141
|
-
moat/kv/auth/root.py,sha256=lW-_hgQp3ZIzAAe4iBl0rdMU-pFuHIC6ObA3rdFXxkk,1303
|
142
|
-
moat/kv/backend/__init__.py,sha256=f5nIOWD2zml2YiaBNXtEOzC7SEGgwDFJMB8YzRISJ0A,1689
|
143
|
-
moat/kv/backend/mqtt.py,sha256=XUwMR8RPzq6EPLub0cy7YzXTS1CkfBZFtZ4W9GTcQBo,2007
|
144
|
-
moat/kv/command/__init__.py,sha256=9_8wL9Scv8_Cs8HJyJHGvx1vwXErsuvlsAqNZLcJQR0,8
|
145
|
-
moat/kv/command/acl.py,sha256=wSdlzKBjWIFX3IxCdLcG3ZqjvtX8KPtqe38ibyU2VDo,4665
|
146
|
-
moat/kv/command/auth.py,sha256=vP22ZIBMjRdUxN4_ELKiDgIE5ZqdMxs1ky1WDVUx50M,7149
|
147
|
-
moat/kv/command/code.py,sha256=ycGBoKBB0Gse3Tt9h9WvgiIZVe3Yg-x92RRjfCCCXVQ,8066
|
148
|
-
moat/kv/command/codec.py,sha256=8GqOl-oxWFM2D1Fm9Iheot2AmS_SsOYfqfbbde3qvQY,6028
|
149
|
-
moat/kv/command/data.py,sha256=ntT6CQkmXtyFMgJNm9WMn23kVP5MR73q53w2WASsoOg,8396
|
150
|
-
moat/kv/command/error.py,sha256=XqHmVJgBGjr6XOozi23wEjiTqPopD1CzkIeR1a3Z_vY,4350
|
151
|
-
moat/kv/command/internal.py,sha256=wjEHTltUXIMEiXriyd5DuTDlaI_2W2uaJIi-dNLT_OA,7397
|
152
|
-
moat/kv/command/job.py,sha256=C2qH7ghQcPL5vj-Pg0YZ2i2Rvg5kpzH58EqBTCaK1Tw,13614
|
153
|
-
moat/kv/command/log.py,sha256=ycdtMgiBw2DaCu0yu6tpWKPLlQ33ZZemXsfwZrCzRGg,1350
|
154
|
-
moat/kv/command/server.py,sha256=Hl_6FFq322c5KjJCKxH1nCrxo-h0VEwH4IOMbVeUBN4,3392
|
155
|
-
moat/kv/command/type.py,sha256=JN0_Abb5wR4UJH5zHnVZgT93NJRYY6qpRD_ZQT13u4k,6226
|
156
|
-
moat/kv/command/dump/__init__.py,sha256=L05R6W9eDzUDAr7UhfEo1lZR-UB0qYUUf-5dRHC-p-0,4000
|
157
|
-
moat/kv/mock/__init__.py,sha256=HW6YAwo_OBVRmTeRCc-ZoUHB7-D78cEONlcb5vACdIE,2760
|
158
|
-
moat/kv/mock/mqtt.py,sha256=b9pzbwQBmTX2eSiSgNO7nh2-7l8-0TT8n2GxinQ-1l0,5213
|
159
|
-
moat/kv/mock/tracer.py,sha256=qLEIn9gdlYUypyRYD8O8SbM8ye8XR4xtBl3otP6uNLs,2058
|
160
|
-
moat/kv/obj/__init__.py,sha256=yeiZ6bWM8XhK28ruqX7RmpPhytYXlOJPRw_hsWbvExk,19800
|
161
|
-
moat/kv/obj/command.py,sha256=QQiOhPtlGV07kuutV0KowmC2HiXhmIFUktofqlRg1GA,7446
|
162
|
-
moat_kv-0.71.0.dist-info/licenses/LICENSE.txt,sha256=L5vKJLVOg5t0CEEPpW9-O_0vzbP0PEjEF06tLvnIDuk,541
|
163
|
-
scripts/current,sha256=91NXrtN9AWtOdwGZs-yTaAgU_EKF4xXPo9Dvr9E3BkA,374
|
164
|
-
scripts/env,sha256=Le76hZQSvDrNiFfhCzK0PDe4STLOdIpMcsQTYgk74Qs,113
|
165
|
-
scripts/init,sha256=gvezyZaPG-6RJ5nLC9Wc0kR_tZaiJAjLpJfRVnyfFik,1071
|
166
|
-
scripts/recover,sha256=dBuIN9v6yJ_dffVAsax8AfnD9oRfQHi0U8kk5w1ReH4,332
|
167
|
-
scripts/rotate,sha256=zoBI7A5hN54TNgC0FYIMGusHmqe1LcICNyhkukL7eYs,837
|
168
|
-
scripts/run,sha256=Zbh5Qa5oYmn-fMpg_qUaPVbJrpDx4ht0rjKSm0eQt7E,795
|
169
|
-
scripts/run-all,sha256=GlheLEcCxQejv0cPmPPHSpXvK0ZcGQ_XDbt7W-ouPTM,220
|
170
|
-
scripts/run-any,sha256=y0y1Lk7ppUnOtiYrcAWHBetsW77nZEmlx-S2A7mhxYg,210
|
171
|
-
scripts/run-single,sha256=GmGi5Nu0uUmcs5PJiEBaEbz3O7k1-669nUoAX-Bj2KQ,316
|
172
|
-
scripts/success,sha256=KCkdAPsgiEiUBcEgluKJFcB5fGk6VEv0Uo8FP9frKLA,33
|
173
|
-
systemd/moat-kv-recover.service,sha256=zqqDEBW21iQ8O2tBdiAMEUoGdgt1ZLLzmhToIAq76Ew,355
|
174
|
-
systemd/moat-kv-rotate.service,sha256=BFhLT6FIwk0w0q9AH_mfKS9S1T0wcjr-8oH01bn2LPI,355
|
175
|
-
systemd/moat-kv-rotate.timer,sha256=vQ6oVU4KhvD9q-90y8GUil1ewIv0ld4jULrLelHJ-2I,161
|
176
|
-
systemd/moat-kv-run-all.service,sha256=D34_d8o3qmNAGEtlqpdx4oaU2jUd7h3qypkjQMcGgHE,428
|
177
|
-
systemd/moat-kv-run-all@.service,sha256=-00TrYu3-3k01spmb0_FfbZFBkzguOMcp3LUyjiesfI,397
|
178
|
-
systemd/moat-kv-run-any.service,sha256=kINPhW7CIQCIuMsuKnXTkzOw9dTZ-ujxpJWWQPcC-Ic,428
|
179
|
-
systemd/moat-kv-run-any@.service,sha256=EQXBp1P-MgAzGD1wr2RXgBDkz_zx1MGcz6FMf09GCwU,397
|
180
|
-
systemd/moat-kv-run-single.service,sha256=ASLd9fH-tY8ZnAsuPmNxiuKaVfGzLC56EJU39UtlEgk,436
|
181
|
-
systemd/moat-kv-run-single@.service,sha256=uhy3Pl9ojm4vJhYVP1CxYdM_e-vtIq0q6b-oWjrdABQ,402
|
182
|
-
systemd/moat-kv.service,sha256=g9BtStXpKDQ0o3Ivgw5t9s5KintzXabJIR6FvL-nJnQ,502
|
183
|
-
systemd/postinst,sha256=INv8dSI8KT5VKX9Fr8uN0l6IbAO3Bi28aTQTgfQArL8,198
|
184
|
-
systemd/sysusers,sha256=swfLW1o9tZ8i1d8KL5JP75R1p7DVMekLX0r-YTNPZlY,78
|
185
|
-
moat_kv-0.71.0.dist-info/METADATA,sha256=sRDrUCQS6Kf6Z6xmDdcXPzbNFv3wougCrsWIRcrqu2c,3271
|
186
|
-
moat_kv-0.71.0.dist-info/WHEEL,sha256=xcaH6rP_nCxh1LBIPM7Q0uOnzSGjsIye-Q44j_zbzw8,104
|
187
|
-
moat_kv-0.71.0.dist-info/top_level.txt,sha256=LyFVSz3-SU-7B8r2qZ3ODVF_QvXqE08qepkD1rfQLk4,56
|
188
|
-
moat_kv-0.71.0.dist-info/RECORD,,
|
scripts/current
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
set -ex
|
3
|
-
|
4
|
-
# This script takes the most-current state files and writes them to the
|
5
|
-
# named file.
|
6
|
-
|
7
|
-
test -n "$1"
|
8
|
-
F="$(python3 -c "import sys; from os.path import abspath; print(abspath(sys.argv[1]))" "$1")"
|
9
|
-
|
10
|
-
mkdir -p "$DEST"
|
11
|
-
cd "$DEST"
|
12
|
-
d=$(find . -name 0.dkv -size +1c -print | sort -r | head -1)
|
13
|
-
cd $(dirname "$d")
|
14
|
-
|
15
|
-
ls | grep '\.dkv$' | sort -n | xargs cat > "$TEMP"
|
scripts/env
DELETED
scripts/init
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
set -ex
|
3
|
-
|
4
|
-
# This script sets up an initial MoaT-KV master.
|
5
|
-
systemd-sysusers --no-pager /usr/lib/sysusers.d/moat-kv.conf
|
6
|
-
|
7
|
-
. /usr/lib/moat/kv/env
|
8
|
-
|
9
|
-
mkdir -p /etc/moat
|
10
|
-
test -f /etc/moat/kv.env || touch /etc/moat/kv.env
|
11
|
-
grep -qs '^MODE=' /etc/moat/kv.env || echo MODE=hybrid >>/etc/moat/kv.env
|
12
|
-
grep -qs '^NAME=' /etc/moat/kv.env || echo NAME=$(hostname) >>/etc/moat/kv.env
|
13
|
-
grep -qs '^LOCAL=' /etc/moat/kv.env || echo LOCAL=no >>/etc/moat/kv.env
|
14
|
-
|
15
|
-
. /etc/moat/kv.env
|
16
|
-
|
17
|
-
if test "$MODE" != "slave" ; then
|
18
|
-
mkdir -p "$DEST"
|
19
|
-
cd "$DEST"
|
20
|
-
d="$(find . -name 0.dkv -size +1c | sort | head -1)"
|
21
|
-
if test -n "$d" ; then
|
22
|
-
d="$(dirname "$d")"
|
23
|
-
else
|
24
|
-
d="$(date -d 2019-01-01 +"$DATE")"
|
25
|
-
mkdir -p "$d"
|
26
|
-
fi
|
27
|
-
cd $d
|
28
|
-
|
29
|
-
if test ! -s "0.dkv" ; then
|
30
|
-
moat kv dump init $NAME 0.dkv
|
31
|
-
chown -R MoaT-KV:MoaT "$DEST"
|
32
|
-
fi
|
33
|
-
fi
|
34
|
-
|
35
|
-
if test "$(moat util cfg kv.conn.host)" = "127.0.0.1" ; then
|
36
|
-
systemctl enable moat-kv.service
|
37
|
-
systemctl enable moat-kv-rotate.timer || true # may be masked
|
38
|
-
systemctl restart moat-kv.service &
|
39
|
-
fi
|