Пример #1
0
def build_payload(action, entry: DatabaseEntry):
    payload = {
        "verb": action,
        "key": entry.key(),
        "data": entry.get_serialized_message()
    }

    return cbor.dumps(payload)
Пример #2
0
 def update_entry(self, entry: DatabaseEntry):
     self.db[entry.key()] = entry.get_serialized_message()