notify

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package notify 는 백업 결과 알림 어댑터다 (B3-3).

설계: docs/11_기능설계/Nullus_백업복구_설계.md §9 F10 (nullus-plan#75)

"백업 실패보다 백업 실패를 모르는 것이 더 나쁘다." 채널 발송은 #63(Alert 채널 1차 확장)에 의존하므로, 그때까지는 최소한 구조화 로그로 남긴다 — 조용히 지나가는 것만은 막는다.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelNotifier

type ChannelNotifier struct {
	// contains filtered or unexported fields
}

ChannelNotifier 는 백업 결과를 조직의 알림 채널(Telegram · 이메일 · Slack)로 보낸다(B3-3, nullus-plan#63).

구조화 로그는 그대로 남긴다 — 채널이 하나도 없거나 발송이 실패해도 결과가 어딘가에는 남아야 한다. 어느 채널로 보낼지는 알림 모듈이 조직의 구독으로 정한다. 백업은 이벤트만 낸다.

발송은 백업을 붙들지 않는다 — 결과를 기록한 뒤 따로 보낸다. 백업의 마무리 ctx(짧다)로 보내면 느린 채널 하나가 시간을 다 써서 다른 채널과 발송 이력까지 사라진다. 발송 결과는 알림 모듈의 이력에 남고, 실패는 여기서 경고 로그로도 남긴다.

func NewChannelNotifier

func NewChannelNotifier(log *LogNotifier, publisher sharednotify.Publisher) *ChannelNotifier

func (*ChannelNotifier) NotifyBackupResult

func (n *ChannelNotifier) NotifyBackupResult(ctx context.Context, run *domain.BackupRun) error

func (*ChannelNotifier) Wait

func (n *ChannelNotifier) Wait()

Wait 는 보내는 중인 알림이 끝나기를 기다린다(테스트 · 종료).

type LogNotifier

type LogNotifier struct {
	// contains filtered or unexported fields
}

func NewLogNotifier

func NewLogNotifier(logger *slog.Logger) *LogNotifier

func (*LogNotifier) NotifyBackupResult

func (n *LogNotifier) NotifyBackupResult(_ context.Context, run *domain.BackupRun) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL