mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-12-16 00:04:13 -05:00
add writer to set_dht_value, allow multiple open_dht_record
This commit is contained in:
parent
fac9937cf4
commit
0c3271b3b9
19 changed files with 161 additions and 66 deletions
|
|
@ -75,7 +75,7 @@ class RoutingContext(ABC):
|
|||
|
||||
@abstractmethod
|
||||
async def set_dht_value(
|
||||
self, key: types.TypedKey, subkey: types.ValueSubkey, data: bytes
|
||||
self, key: types.TypedKey, subkey: types.ValueSubkey, data: bytes, writer: Optional[types.KeyPair]
|
||||
) -> Optional[types.ValueData]:
|
||||
pass
|
||||
|
||||
|
|
|
|||
|
|
@ -626,7 +626,7 @@ class _JsonRoutingContext(RoutingContext):
|
|||
return None if ret is None else ValueData.from_json(ret)
|
||||
|
||||
async def set_dht_value(
|
||||
self, key: TypedKey, subkey: ValueSubkey, data: bytes
|
||||
self, key: TypedKey, subkey: ValueSubkey, data: bytes, writer: Optional[KeyPair]
|
||||
) -> Optional[ValueData]:
|
||||
ret = raise_api_result(
|
||||
await self.api.send_ndjson_request(
|
||||
|
|
@ -637,6 +637,7 @@ class _JsonRoutingContext(RoutingContext):
|
|||
key=key,
|
||||
subkey=subkey,
|
||||
data=data,
|
||||
writer=writer,
|
||||
)
|
||||
)
|
||||
return None if ret is None else ValueData.from_json(ret)
|
||||
|
|
|
|||
|
|
@ -451,6 +451,12 @@
|
|||
"type": "integer",
|
||||
"format": "uint32",
|
||||
"minimum": 0.0
|
||||
},
|
||||
"writer": {
|
||||
"type": [
|
||||
"string",
|
||||
"null"
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue