You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
828 B
Python
53 lines
828 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import (
|
|
Mapping,
|
|
Sequence,
|
|
)
|
|
from decimal import (
|
|
Decimal,
|
|
)
|
|
from functools import (
|
|
partial,
|
|
)
|
|
from typing import (
|
|
TypeAlias,
|
|
NewType,
|
|
Union,
|
|
)
|
|
from uuid import (
|
|
UUID,
|
|
)
|
|
|
|
from attrs import (
|
|
define,
|
|
)
|
|
|
|
|
|
JSON: TypeAlias = Union[
|
|
Mapping[str, "JSON"],
|
|
Sequence["JSON"],
|
|
str,
|
|
int,
|
|
Decimal,
|
|
bool,
|
|
]
|
|
|
|
|
|
serializable = partial(
|
|
define,
|
|
frozen=True,
|
|
kw_only=True,
|
|
)
|
|
|
|
|
|
ReverseDomainArg = NewType("ReverseDomainArg", str)
|
|
"""e.g. `"de.6nw.enjo.controller"`"""
|
|
|
|
|
|
InstanceId = NewType("InstanceId", UUID)
|
|
ServiceType = NewType("ServiceType", ReverseDomainArg)
|
|
ServiceClass = NewType("ServiceClass", ReverseDomainArg)
|
|
EpochId = NewType("EpochId", UUID)
|
|
HumanFriendlyDesc = NewType("HumanFriendlyDesc", str)
|