Documentation
¶
Overview ¶
Package notification 은 알림 채널 모듈이다(nullus-plan#63) — Telegram · 이메일(SMTP) · Slack.
조직이 채널을 등록하고 받을 이벤트를 고르면, 다른 모듈이 낸 이벤트(sharednotify.Event)가 그 채널로 간다. 지금 이벤트를 내는 곳은 백업(B3-3)이다. 설계: docs/11_기능설계/Nullus_알림_채널_설계.md.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Pool *pgxpool.Pool
// EncryptionKey 는 채널 비밀(봇 토큰 · 웹훅 URL · SMTP 비밀번호)을 암호화하는 키다(ENCRYPTION_KEY).
EncryptionKey []byte
// TelegramAPIURL 은 Bot API 주소다. 비면 https://api.telegram.org (NULLUS_TELEGRAM_API_URL).
TelegramAPIURL string
Logger *slog.Logger
}
Deps 는 모듈을 조립하는 데 필요한 것이다.
type Module ¶
type Module struct {
Channels *usecase.ChannelService
SendTest *usecase.SendTest
Deliveries *usecase.ListDeliveries
Publisher sharednotify.Publisher
}
Module 은 조립된 알림 모듈이다. 유스케이스는 main 이 관리자 API 핸들러(adapter/handler)를 만들 때 쓰고, Publisher 는 다른 모듈이 이벤트를 내는 창구다.
Directories
¶
| Path | Synopsis |
|---|---|
|
adapter
|
|
|
handler
Package handler 는 알림 채널 API 다(관리자 전용 — /api/v1/admin/notifications).
|
Package handler 는 알림 채널 API 다(관리자 전용 — /api/v1/admin/notifications). |
|
repository
Package repository 는 알림 채널과 발송 이력의 Postgres 구현이다.
|
Package repository 는 알림 채널과 발송 이력의 Postgres 구현이다. |
|
sender
Package sender 는 채널 종류마다 메시지를 실제로 보내는 어댑터다 — Slack Incoming Webhook, Telegram Bot API, SMTP.
|
Package sender 는 채널 종류마다 메시지를 실제로 보내는 어댑터다 — Slack Incoming Webhook, Telegram Bot API, SMTP. |
|
Package domain 은 알림 채널과 보낼 메시지다(nullus-plan#63, 설계 docs/11_기능설계/Nullus_알림_채널_설계.md).
|
Package domain 은 알림 채널과 보낼 메시지다(nullus-plan#63, 설계 docs/11_기능설계/Nullus_알림_채널_설계.md). |
|
Package port 는 알림 모듈의 바깥 경계다.
|
Package port 는 알림 모듈의 바깥 경계다. |
|
Package usecase 는 알림 채널 관리와 발송이다.
|
Package usecase 는 알림 채널 관리와 발송이다. |
Click to show internal directories.
Click to hide internal directories.