Documentation
¶
Overview ¶
Package port 는 알림 모듈의 바깥 경계다.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelRepository ¶
type ChannelRepository interface {
Create(ctx context.Context, ch *domain.Channel) error
Get(ctx context.Context, orgID, id string) (*domain.Channel, error)
List(ctx context.Context, orgID string) ([]*domain.Channel, error)
Update(ctx context.Context, ch *domain.Channel) error
Delete(ctx context.Context, orgID, id string) error
}
ChannelRepository 는 채널을 저장한다. Secret 의 암호화·복호화는 구현체의 일이다 — 유스케이스는 평문만 본다. Get·Update·Delete 는 조직이 다르면 domain.ErrChannelNotFound 다.
type DeliveryRepository ¶
type DeliveryRepository interface {
Record(ctx context.Context, d *domain.Delivery) error
List(ctx context.Context, orgID string, limit int) ([]*domain.Delivery, error)
}
DeliveryRepository 는 발송 이력이다.
type SendError ¶
SendError 는 보내는 쪽이 실패를 분류한 것이다. Retryable 이면 잠시 뒤 다시 보낸다(네트워크 · 5xx · 429). 설정이 틀린 실패(401 · 404 · 잘못된 chat_id)는 다시 보내도 같다.
Err 의 문구에 비밀(봇 토큰 · 웹훅 URL)이 들어가지 않게 하는 것은 보내는 쪽의 책임이다 — 이 문구는 발송 이력과 화면에 그대로 남는다.
func AsSendError ¶
AsSendError 는 err 가 SendError 면 꺼낸다. 아니면 다시 보내지 않는 실패로 본다.
Click to show internal directories.
Click to hide internal directories.