|
1 | | - |
2 | | -class StorageType: |
3 | | - FILE: "StorageType" |
4 | | - MEMORY: "StorageType" |
| 1 | +from natsrpy._inner.js.stream import StorageType, Source, Placement, Republish |
5 | 2 |
|
6 | 3 | class KVConfig: |
| 4 | + """ |
| 5 | + KV bucket config. |
| 6 | +
|
| 7 | + Used for creating or updating KV buckets. |
| 8 | + """ |
| 9 | + |
| 10 | + bucket: str |
| 11 | + description: str |
| 12 | + max_value_size: int | None |
| 13 | + history: int | None |
| 14 | + max_age: float | None |
| 15 | + max_bytes: int | None |
| 16 | + storage: StorageType | None |
| 17 | + num_replicas: int | None |
| 18 | + republish: Republish | None |
| 19 | + mirror: Source | None |
| 20 | + sources: list[Source] | None |
| 21 | + mirror_direct: bool | None |
| 22 | + compression: bool | None |
| 23 | + placement: Placement | None |
| 24 | + limit_markers: float | None |
| 25 | + |
7 | 26 | def __init__( |
8 | 27 | self, |
9 | 28 | bucket: str, |
10 | 29 | description: str | None = None, |
11 | 30 | max_value_size: int | None = None, |
12 | | - history:int|None=None, |
13 | | - max_age:float |None=None, |
14 | | - max_bytes:int |None=None, |
15 | | - storage:StorageType|None=None, |
16 | | - num_replicas: int |None=None, |
17 | | - republish:bool |None=None, |
18 | | - mirror:|None=None, |
19 | | - sources:|None=None, |
20 | | - mirror_direct:|None=None, |
21 | | - compression:|None=None, |
22 | | - placement:|None=None, |
23 | | - limit_markers:|None=None, |
| 31 | + history: int | None = None, |
| 32 | + max_age: float | None = None, |
| 33 | + max_bytes: int | None = None, |
| 34 | + storage: StorageType | None = None, |
| 35 | + num_replicas: int | None = None, |
| 36 | + republish: Republish | None = None, |
| 37 | + mirror: Source | None = None, |
| 38 | + sources: list[Source] | None = None, |
| 39 | + mirror_direct: bool | None = None, |
| 40 | + compression: bool | None = None, |
| 41 | + placement: Placement | None = None, |
| 42 | + limit_markers: float | None = None, |
24 | 43 | ) -> None: ... |
25 | 44 |
|
26 | 45 | class KeyValue: |
27 | | - async def get(self, key: str) -> bytes | None: ... |
28 | 46 | async def put(self, key: str, value: bytes) -> int: ... |
| 47 | + async def get(self, key: str) -> bytes | None: ... |
| 48 | + async def delete(self, key: str) -> int: ... |
0 commit comments