maleo-foundation 0.2.86__py3-none-any.whl → 0.2.88__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.
@@ -51,7 +51,7 @@ class GoogleCloudStorage(GoogleClientManager):
51
51
  self._client = None
52
52
  self._logger.info("Client manager disposed successfully")
53
53
 
54
- def upload(
54
+ async def upload(
55
55
  self,
56
56
  content:bytes,
57
57
  location:str,
@@ -59,7 +59,7 @@ class GoogleCloudStorage(GoogleClientManager):
59
59
  make_public:bool=False,
60
60
  expiration:BaseEnums=BaseEnums.Expiration.EXP_15MN,
61
61
  root_location_override:BaseTypes.OptionalString=None,
62
- set_in_redis:bool=False
62
+ set_in_redis:bool=True
63
63
  ) -> str:
64
64
  """
65
65
  Upload a file to Google Cloud Storage.
@@ -93,18 +93,18 @@ class GoogleCloudStorage(GoogleClientManager):
93
93
 
94
94
  if set_in_redis:
95
95
  if make_public:
96
- self._redis.set(f"{self.key}:{blob_name}", url)
96
+ await self._redis.set(f"{self.key}:{blob_name}", url)
97
97
  else:
98
- self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
98
+ await self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
99
99
 
100
100
  return url
101
101
 
102
- def generate_signed_url(
102
+ async def generate_signed_url(
103
103
  self,
104
104
  location:str,
105
105
  expiration:BaseEnums=BaseEnums.Expiration.EXP_15MN,
106
106
  root_location_override:BaseTypes.OptionalString=None,
107
- use_redis:bool=False
107
+ use_redis:bool=True
108
108
  ) -> str:
109
109
  """
110
110
  generate signed URL of a file in the bucket based on its location.
@@ -134,7 +134,7 @@ class GoogleCloudStorage(GoogleClientManager):
134
134
  if use_redis:
135
135
  if self._redis is None:
136
136
  raise ValueError("Can not use redis. Redis is not initialized")
137
- url = self._redis.get(blob_name)
137
+ url = await self._redis.get(blob_name)
138
138
  if url is not None:
139
139
  return url
140
140
 
@@ -143,5 +143,5 @@ class GoogleCloudStorage(GoogleClientManager):
143
143
  expiration=timedelta(seconds=int(expiration)),
144
144
  method="GET"
145
145
  )
146
- self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
146
+ await self._redis.set(f"{self.key}:{blob_name}", url, ex=int(expiration))
147
147
  return url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: maleo_foundation
3
- Version: 0.2.86
3
+ Version: 0.2.88
4
4
  Summary: Foundation package for Maleo
5
5
  Author-email: Agra Bima Yuda <agra@nexmedis.com>
6
6
  License: MIT
@@ -45,7 +45,7 @@ maleo_foundation/managers/client/google/__init__.py,sha256=47DEQpj8HBSa-_TImW-5J
45
45
  maleo_foundation/managers/client/google/base.py,sha256=eIdd6C2BFIu4EyZ1j017VZaJn_nSTPGFftBwQmVAUDA,1366
46
46
  maleo_foundation/managers/client/google/parameter.py,sha256=Lnj7mQgxWQpsQwbmDRK5_bF01M1QpM5PS0eZP2q17yQ,1337
47
47
  maleo_foundation/managers/client/google/secret.py,sha256=Ski1CHYeA8vjSk2Oc2Pf4CfFrzT_RcA6NEZwza7gM7Y,4464
48
- maleo_foundation/managers/client/google/storage.py,sha256=Hq79cVreWR2AGwUzpD57NzziZjqxj__TqYIBRy-A9A0,5340
48
+ maleo_foundation/managers/client/google/storage.py,sha256=lDJNCbH-OMU51mBBtTTl9Yrzs-aE44bf0UAv6fzhbzw,5374
49
49
  maleo_foundation/middlewares/authentication.py,sha256=UL6kL65SvqrzemlIDopoO9N1C05eWlYMHVR2tiRsVEA,4821
50
50
  maleo_foundation/middlewares/base.py,sha256=LhsLbZARC4lwGpaIeCfhHFa4YbN3210JnmUEKSTDZW0,16299
51
51
  maleo_foundation/middlewares/cors.py,sha256=9uvBvY2N6Vxa9RP_YtESxcWo6Doi6uS0lzAG9iLY7Uc,2288
@@ -119,7 +119,7 @@ maleo_foundation/utils/loaders/credential/__init__.py,sha256=qopTKvcMVoTFwyRijeg
119
119
  maleo_foundation/utils/loaders/credential/google.py,sha256=HUcuHD4tXHPt0eHInlFYxA_MDrGSOtbenpd0PX156OM,1255
120
120
  maleo_foundation/utils/loaders/key/__init__.py,sha256=hVygcC2ImHc_aVrSrOmyedR8tMUZokWUKCKOSh5ctbo,106
121
121
  maleo_foundation/utils/loaders/key/rsa.py,sha256=gDhyX6iTFtHiluuhFCozaZ3pOLKU2Y9TlrNMK_GVyGU,3796
122
- maleo_foundation-0.2.86.dist-info/METADATA,sha256=fgPM_Hdb2sTWUCBE5S6o3V8EuomWVTSgM_XO8bvdcGU,3598
123
- maleo_foundation-0.2.86.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
- maleo_foundation-0.2.86.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
125
- maleo_foundation-0.2.86.dist-info/RECORD,,
122
+ maleo_foundation-0.2.88.dist-info/METADATA,sha256=yJMZP3vENfE20gahejM4LD1-3kGELvbqxpD-g7rmE0E,3598
123
+ maleo_foundation-0.2.88.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
124
+ maleo_foundation-0.2.88.dist-info/top_level.txt,sha256=_iBos3F_bhEOdjOnzeiEYSrCucasc810xXtLBXI8cQc,17
125
+ maleo_foundation-0.2.88.dist-info/RECORD,,