notification

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package notification provides tenant-scoped notification administration, durable publication, and worker delivery orchestration.

Index

Constants

View Source
const JobKind = "notification.deliver"

Variables

This section is empty.

Functions

This section is empty.

Types

type ChannelInput

type ChannelInput struct {
	Name       string             `json:"name"`
	Type       domain.ChannelType `json:"type"`
	Enabled    bool               `json:"enabled"`
	URL        string             `json:"url,omitempty"`
	Secret     string             `json:"secret,omitempty"`
	Recipients []string           `json:"recipients,omitempty"`
	Revision   int                `json:"revision,omitempty"`
}

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 (*Service) CreateChannel

func (s *Service) CreateChannel(ctx context.Context, actor string, in ChannelInput) (domain.Channel, error)

func (*Service) CreateRule

func (s *Service) CreateRule(ctx context.Context, actor string, in RuleInput) (domain.Rule, error)

func (*Service) DeleteChannel

func (s *Service) DeleteChannel(ctx context.Context, actor string, id shared.ID, revision int) error

func (*Service) DeleteRule

func (s *Service) DeleteRule(ctx context.Context, actor string, id shared.ID, revision int) error

func (*Service) GetChannel

func (s *Service) GetChannel(ctx context.Context, id shared.ID) (domain.Channel, error)

func (*Service) GetDelivery

func (s *Service) GetDelivery(ctx context.Context, id shared.ID) (domain.Delivery, error)

func (*Service) GetRule

func (s *Service) GetRule(ctx context.Context, id shared.ID) (domain.Rule, error)

func (*Service) HandleJob

func (s *Service) HandleJob(ctx context.Context, job ports.QueuedJob) error

func (*Service) ListAttempts

func (s *Service) ListAttempts(ctx context.Context, did shared.ID) ([]domain.Attempt, error)

func (*Service) ListChannels

func (s *Service) ListChannels(ctx context.Context) ([]domain.Channel, error)

func (*Service) ListDeliveries

func (s *Service) ListDeliveries(ctx context.Context, f ports.NotificationDeliveryFilter) (domain.Page, error)

func (*Service) ListRules

func (s *Service) ListRules(ctx context.Context) ([]domain.Rule, error)

func (*Service) OnDeadLetter

func (s *Service) OnDeadLetter(ctx context.Context, job ports.QueuedJob, cause error) error

func (*Service) Publish

func (s *Service) Publish(ctx context.Context, e domain.Event) ([]shared.ID, error)

func (*Service) SetTransactionRunner

func (s *Service) SetTransactionRunner(tx ports.TenantTransactionRunner)

SetTransactionRunner makes administration and its audit append atomic.

func (*Service) TestChannel

func (s *Service) TestChannel(ctx context.Context, actor string, id shared.ID) (shared.ID, error)

func (*Service) UpdateChannel

func (s *Service) UpdateChannel(ctx context.Context, actor string, id shared.ID, in ChannelInput) (domain.Channel, error)

func (*Service) UpdateRule

func (s *Service) UpdateRule(ctx context.Context, actor string, id shared.ID, in RuleInput) (domain.Rule, error)

Jump to

Keyboard shortcuts

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