Documentation
¶
Overview ¶
Package notification provides tenant-scoped notification administration, durable publication, and worker delivery orchestration.
Index ¶
- Constants
- type ChannelInput
- type DeliveryError
- type RuleInput
- type Service
- func (s *Service) CreateChannel(ctx context.Context, actor string, in ChannelInput) (domain.Channel, error)
- func (s *Service) CreateRule(ctx context.Context, actor string, in RuleInput) (domain.Rule, error)
- func (s *Service) DeleteChannel(ctx context.Context, actor string, id shared.ID, revision int) error
- func (s *Service) DeleteRule(ctx context.Context, actor string, id shared.ID, revision int) error
- func (s *Service) GetChannel(ctx context.Context, id shared.ID) (domain.Channel, error)
- func (s *Service) GetDelivery(ctx context.Context, id shared.ID) (domain.Delivery, error)
- func (s *Service) GetRule(ctx context.Context, id shared.ID) (domain.Rule, error)
- func (s *Service) HandleJob(ctx context.Context, job ports.QueuedJob) error
- func (s *Service) ListAttempts(ctx context.Context, did shared.ID) ([]domain.Attempt, error)
- func (s *Service) ListChannels(ctx context.Context) ([]domain.Channel, error)
- func (s *Service) ListDeliveries(ctx context.Context, f ports.NotificationDeliveryFilter) (domain.Page, error)
- func (s *Service) ListRules(ctx context.Context) ([]domain.Rule, error)
- func (s *Service) OnDeadLetter(ctx context.Context, job ports.QueuedJob, cause error) error
- func (s *Service) Publish(ctx context.Context, e domain.Event) ([]shared.ID, error)
- func (s *Service) SetTransactionRunner(tx ports.TenantTransactionRunner)
- func (s *Service) TestChannel(ctx context.Context, actor string, id shared.ID) (shared.ID, error)
- func (s *Service) UpdateChannel(ctx context.Context, actor string, id shared.ID, in ChannelInput) (domain.Channel, error)
- func (s *Service) UpdateRule(ctx context.Context, actor string, id shared.ID, in RuleInput) (domain.Rule, error)
Constants ¶
View Source
const JobKind = "notification.deliver"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChannelInput ¶
type DeliveryError ¶
type DeliveryError struct {
// contains filtered or unexported fields
}
DeliveryError lets the generic worker schedule a channel-specific retry or stop immediately on a permanent transport response.
func (*DeliveryError) Error ¶
func (e *DeliveryError) Error() string
func (*DeliveryError) MaxAttempts ¶
func (e *DeliveryError) MaxAttempts() int
func (*DeliveryError) RetryAfter ¶
func (e *DeliveryError) RetryAfter() time.Duration
func (*DeliveryError) Terminal ¶
func (e *DeliveryError) Terminal() bool
func (*DeliveryError) Unwrap ¶
func (e *DeliveryError) Unwrap() error
type RuleInput ¶
type RuleInput struct {
Name string `json:"name"`
Enabled bool `json:"enabled"`
EventType domain.EventType `json:"event_type"`
MinSeverity shared.Severity `json:"min_severity,omitempty"`
ActionTypes []string `json:"action_types,omitempty"`
EngagementIDs []shared.ID `json:"engagement_ids,omitempty"`
TeamIDs []shared.ID `json:"team_ids,omitempty"`
AllTeams bool `json:"all_teams,omitempty"`
ChannelIDs []shared.ID `json:"channel_ids"`
LeadTimeSeconds int64 `json:"lead_time_seconds,omitempty"`
Revision int `json:"revision,omitempty"`
}
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo ports.NotificationRepository, protector ports.NotificationSecretProtector, sender ports.NotificationSender, audit ports.AuditLogger, clock ports.Clock, ids ports.IDGenerator) (*Service, error)
func (*Service) CreateChannel ¶
func (*Service) CreateRule ¶
func (*Service) DeleteChannel ¶
func (*Service) DeleteRule ¶
func (*Service) GetChannel ¶
func (*Service) GetDelivery ¶
func (*Service) ListAttempts ¶
func (*Service) ListChannels ¶
func (*Service) ListDeliveries ¶
func (*Service) OnDeadLetter ¶
func (*Service) SetTransactionRunner ¶
func (s *Service) SetTransactionRunner(tx ports.TenantTransactionRunner)
SetTransactionRunner makes administration and its audit append atomic.
func (*Service) TestChannel ¶
func (*Service) UpdateChannel ¶
Click to show internal directories.
Click to hide internal directories.