maleo-foundation 0.0.2__py3-none-any.whl → 0.0.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,21 +3,21 @@ from contextlib import asynccontextmanager
3
3
  from typing import AsyncGenerator, Optional
4
4
 
5
5
  class HTTPClientManager:
6
- _client:Optional[httpx.AsyncClient] = None
6
+ client:Optional[httpx.AsyncClient] = None
7
7
 
8
8
  @classmethod
9
9
  def initialize(cls) -> None:
10
10
  """Initialize the HTTP client if not already initialized."""
11
- if cls._client is None:
12
- cls._client = httpx.AsyncClient()
11
+ if cls.client is None:
12
+ cls.client = httpx.AsyncClient()
13
13
 
14
14
  @classmethod
15
15
  async def _client_handler(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
16
16
  """Reusable generator for client handling."""
17
- if cls._client is None:
17
+ if cls.client is None:
18
18
  raise RuntimeError("Client has not been initialized. Call initialize first.")
19
19
 
20
- yield cls._client
20
+ yield cls.client
21
21
 
22
22
  @classmethod
23
23
  async def inject(cls) -> AsyncGenerator[httpx.AsyncClient, None]:
@@ -36,6 +36,6 @@ class HTTPClientManager:
36
36
  @classmethod
37
37
  async def dispose(cls) -> None:
38
38
  """Dispose of the HTTP client and release any resources."""
39
- if cls._client is not None:
40
- await cls._client.aclose()
41
- cls._client = None
39
+ if cls.client is not None:
40
+ await cls.client.aclose()
41
+ cls.client = None
@@ -34,6 +34,12 @@ class BaseEnums:
34
34
  ID = "id"
35
35
  UUID = "uuid"
36
36
 
37
+ class ServiceControllerType(StrEnum):
38
+ REST = "rest"
39
+
40
+ class ClientControllerType(StrEnum):
41
+ HTTP = "http"
42
+
37
43
  class RESTControllerResponseType(StrEnum):
38
44
  NONE = "none"
39
45
  HTML = "html"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -3,7 +3,7 @@ maleo_foundation/constants.py,sha256=l6WQp0nu2y4Ucs8bFcEdzVUJfR1dRM_nveuHGMhe3rY
3
3
  maleo_foundation/controller.py,sha256=91OK1W4MnO85m0GUOQv1F8m50nlTZpZJ2HJcScH7OGA,2980
4
4
  maleo_foundation/clients/__init__.py,sha256=W8vydJYeDEi6gdmOZSBFSSDsfZJtb8C05CHErZgsZ30,188
5
5
  maleo_foundation/clients/general/__init__.py,sha256=l9eQrBeLW4aXtGU5aK3i6fD-msVR4526W7D9V8WCXIg,91
6
- maleo_foundation/clients/general/http.py,sha256=cE-sYlC1fXURwxE1d8pgNoUU9GKKSlPbwqF4EbslX8Q,1361
6
+ maleo_foundation/clients/general/http.py,sha256=Awvs470hgdhZSZW_uoIFJGcJ5hcfDEIX0A2yUaP9UCA,1353
7
7
  maleo_foundation/clients/google/__init__.py,sha256=1uv6nF9QbATsSAcMimQOT7Y-eBljjDunBojNX6oAtS8,90
8
8
  maleo_foundation/clients/google/cloud/__init__.py,sha256=WGMPxEKKdkz3XGY5dZn9E-nYhD1kv1MgRHbmVnky4zk,245
9
9
  maleo_foundation/clients/google/cloud/logging.py,sha256=l8EL8rZAf1uatMil_ARmRL0z4K4iX2HqUUpdctNGXMw,1584
@@ -14,7 +14,7 @@ maleo_foundation/db/database.py,sha256=RQBWeUearfrgq2L8-8cFVBByjNku9OiY3AmucRWXU
14
14
  maleo_foundation/db/engine.py,sha256=kw2SMMiWy5KARquh4TLk7v6HwlHW97lUIUvqdFbhNxk,1600
15
15
  maleo_foundation/db/session.py,sha256=tI13DJ6rLo8FOpSIFZrmD4dbuxY_c0RTjwEGb76ZOo0,2681
16
16
  maleo_foundation/models/__init__.py,sha256=Wh92XAduE1Sg9qi2GMhptyXig0fKcTS5AbGo3tE3tLs,348
17
- maleo_foundation/models/enums.py,sha256=4tEr9a8jevEvLwwxTGRxXOtqwmmD_Ftcxo8IXUbMBA8,2074
17
+ maleo_foundation/models/enums.py,sha256=Ob2v312JxypHEq7hTKZKOV462FEeLkIjIhpx-YF6Jdw,2203
18
18
  maleo_foundation/models/responses.py,sha256=z2XEHwuxU05NDJSgrA7B7e2fzEQP6Kl3ZM2BO-lDw_A,3786
19
19
  maleo_foundation/models/schemas/__init__.py,sha256=Xj8Ahsqyra-fmEaVcGPok5GOOsPQlKcknHYMvbjvENA,277
20
20
  maleo_foundation/models/schemas/general.py,sha256=cMi3Onimzn3_wZdKMV-ufl25_xQVw3WaUaJOOZko9Z4,4813
@@ -44,7 +44,7 @@ maleo_foundation/utils/exceptions.py,sha256=mcvBwHm6uWpVQkPtO1T2j-GaTYEiyPOeGxiD
44
44
  maleo_foundation/utils/logger.py,sha256=ICrFi0MxuAjDy8KTRL7pex1miwzZqZX-HHArgN3niJM,2453
45
45
  maleo_foundation/utils/formatter/__init__.py,sha256=iKf5YCbEdg1qKnFHyKqqcQbqAqEeRUf8mhI3v3dQoj8,78
46
46
  maleo_foundation/utils/formatter/case.py,sha256=TmvvlfzGdC_omMTB5vAa40TZBxQ3hnr-SYeo0M52Rlg,1352
47
- maleo_foundation-0.0.2.dist-info/METADATA,sha256=BjDY-k-f58-j7b4v-ae_i7liFamCaNPvZCnfgzdYXcQ,3159
48
- maleo_foundation-0.0.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
49
- maleo_foundation-0.0.2.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
50
- maleo_foundation-0.0.2.dist-info/RECORD,,
47
+ maleo_foundation-0.0.4.dist-info/METADATA,sha256=USiuKz6SD8xifpC1_nsEDXd9zVMGO10Kw0EyflzNnoI,3159
48
+ maleo_foundation-0.0.4.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
49
+ maleo_foundation-0.0.4.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
50
+ maleo_foundation-0.0.4.dist-info/RECORD,,