chore: initialize containerized Python learning workbook (2026 DevOps/SRE)
This commit is contained in:
commit
ae4c421815
63 files changed
+1273
No files matched your search
@@ -0,0 +1,25 @@
|
||||
from typing import Protocol
|
||||
|
||||
|
||||
class KvStore(Protocol):
|
||||
def get(self, key: str) -> str | None: ...
|
||||
def set(self, key: str, value: str) -> None: ...
|
||||
|
||||
|
||||
class InMemoryKvStore:
|
||||
def __init__(self) -> None:
|
||||
self._data: dict[str, str] = {}
|
||||
|
||||
def get(self, key: str) -> str | None:
|
||||
raise NotImplementedError("Pobierz wartość lub None")
|
||||
|
||||
def set(self, key: str, value: str) -> None:
|
||||
raise NotImplementedError("Zapisz wartość w słowniku")
|
||||
|
||||
|
||||
class FeatureFlagService:
|
||||
def __init__(self, store: KvStore) -> None:
|
||||
self._store = store
|
||||
|
||||
def is_enabled(self, flag: str) -> bool:
|
||||
raise NotImplementedError("Zwróć True jeśli wartość flagi to 'true' lub '1' (lowercase)")
|
||||
Reference in new issue
Block a user