Further isolated json specifics to their own module under protocols/json Moved global packet classes to their own protocols/packets module Implemented ConnectorEndpoint and ConnectorRegistry as transport agnostic connector endpoints for universal connector handling, exposed a ConnectorRegistry API that will need to be made available to the JsonServer for it to be able to register and unregister endpoints as it opens and closes connections Implemented a top down shutdown architecture where each object is responsible for its children, this allows for a logical and heirachical flow, each object has its own stop event, which when its stop method is called, it sets and then awaits the stopped event to be set by any worker threads etc, with a mandatory timeout to avoid hanging on shutdown
19 lines
653 B
Python
19 lines
653 B
Python
# Copyright (C) 2026 Hector van der Aa <hector@h3cx.dev>
|
|
# Copyright (C) 2026 Association Exergie <association.exergie@gmail.com>
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
from typing import Literal
|
|
from uuid import UUID
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class VersionDescriptor(BaseModel):
|
|
model_config = ConfigDict(frozen=True, populate_by_name=True, extra="forbid")
|
|
type: Literal["alpha", "beta", "release"] = Field(alias="type")
|
|
major: int = Field(ge=0)
|
|
minor: int = Field(ge=0)
|
|
patch: int = Field(ge=0)
|
|
|
|
def get_version(self) -> str:
|
|
return f"{self.major}.{self.minor}.{self.patch}-{self.type}"
|