Skip to content

Commit

Permalink
fix: Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Sep 6, 2023
1 parent bf255fe commit d362e59
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/callosum/lower/redis_common.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def redis_addr_to_url(
value: str | tuple[str, int],
*,
scheme: str = "redis",
) -> str:
match value:
case str():
return f"{scheme}://{value}"
case (host, port):
return f"{scheme}://{host}:{port}"
case _:
raise ValueError("unrecognized address format", value)

0 comments on commit d362e59

Please sign in to comment.