Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func RegisterRoutes(router *gin.RouterGroup, deps *app.RuntimeDeps)
RegisterRoutes registers notification routes.
Types ¶
type DeliveryJob ¶
type DeliveryJobPostgres ¶
type DeliveryJobPostgres struct {
// contains filtered or unexported fields
}
DeliveryJobPostgres implements Repository using PostgreSQL.
func (*DeliveryJobPostgres) CreateDelivery ¶
func (r *DeliveryJobPostgres) CreateDelivery(ctx context.Context, in DeliveryJob) (DeliveryJob, error)
CreateDelivery creates a new delivery job record.
func (*DeliveryJobPostgres) MarkDelivered ¶
func (r *DeliveryJobPostgres) MarkDelivered(ctx context.Context, jobID string) error
MarkDelivered updates the delivery job status to delivered.
func (*DeliveryJobPostgres) MarkFailed ¶
MarkFailed updates the delivery job status to failed with a reason.
type EmailMessage ¶
type NotificationHandler ¶
type NotificationHandler struct {
// contains filtered or unexported fields
}
NotificationHandler handles HTTP requests for notification operations.
func NewNotificationHandler ¶
func NewNotificationHandler(service Service, logger *logger.Logger) *NotificationHandler
NewNotificationHandler creates a new notification handler.
func (*NotificationHandler) SendEmail ¶
func (h *NotificationHandler) SendEmail(c *gin.Context)
SendEmail handles POST /notifications/email
type NotificationService ¶
type NotificationService struct {
// contains filtered or unexported fields
}
NotificationService implements the Service interface for notification operations.
func NewNotificationService ¶
func NewNotificationService(logger *logger.Logger) (*NotificationService, error)
NewNotificationService creates a new notification service instance.
func (*NotificationService) QueueEmail ¶
func (s *NotificationService) QueueEmail(ctx context.Context, in QueueEmailInput) (DeliveryJob, error)
QueueEmail queues an email for sending and creates a delivery job record.
func (*NotificationService) WithProvider ¶
func (s *NotificationService) WithProvider(p Provider) *NotificationService
WithProvider sets the provider for the notification service.
func (*NotificationService) WithRepository ¶
func (s *NotificationService) WithRepository(r Repository) *NotificationService
WithRepository sets the repository for the notification service.
type QueueEmailInput ¶
type Repository ¶
type Repository interface {
CreateDelivery(ctx context.Context, in DeliveryJob) (DeliveryJob, error)
MarkDelivered(ctx context.Context, jobID string) error
MarkFailed(ctx context.Context, jobID string, reason string) error
}
func NewDeliveryJobPostgres ¶
func NewDeliveryJobPostgres(db *database.Postgres) Repository
NewDeliveryJobPostgres creates a new PostgreSQL delivery job repository.
type Service ¶
type Service interface {
QueueEmail(ctx context.Context, in QueueEmailInput) (DeliveryJob, error)
}