trace/services/notify-gateway/notifiers/base.py
Lee 19afaffbb7
All checks were successful
Java Maven 3.9.9 & JDK 26 CI/CD Pipeline / build-and-deploy (push) Successful in 3m22s
feat: add shared notification gateway
2026-09-07 17:50:25 +08:00

19 lines
431 B
Python

from abc import ABC, abstractmethod
from dataclasses import dataclass
@dataclass(frozen=True)
class ImageAttachment:
filename: str
content_type: str
data: bytes
class Notifier(ABC):
name = "base"
@abstractmethod
async def send(self, title: str, text: str,
images: list[ImageAttachment] | None = None) -> None:
"""Deliver one notification or raise so the caller can retry."""