Documentation
¶
Overview ¶
Package sendramp implements durable, per-domain recipient-volume ramping for the asynchronous outbound delivery worker.
Index ¶
- Constants
- Variables
- func Qualifies(confirmed, limit int) bool
- type Decision
- type MaintenanceArgs
- type MaintenanceJobs
- type MaintenanceWorker
- type PermanentError
- type ReserveRequest
- type Schedule
- type Snapshot
- type Store
- func (s *Store) Confirm(ctx context.Context, messageID string) error
- func (s *Store) Exempt(ctx context.Context, userID, domain string) error
- func (s *Store) Release(ctx context.Context, messageID string) error
- func (s *Store) Reserve(ctx context.Context, req ReserveRequest) (Decision, error)
- func (s *Store) Resolve(ctx context.Context, messageID string) error
- func (s *Store) Snapshot(ctx context.Context, userID, domain string, now time.Time) (Snapshot, error)
- func (s *Store) Sweep(ctx context.Context, now time.Time) error
Constants ¶
View Source
const ( StatusInactive = "inactive" StatusRamping = "ramping" StatusComplete = "complete" StatusExempt = "exempt" )
View Source
const MinimumStartDaily = 50
Variables ¶
View Source
var DefaultSchedule = Schedule{StartDaily: 50, TargetDaily: 2000, RampDays: 30}
Functions ¶
Types ¶
type MaintenanceArgs ¶
type MaintenanceArgs struct{}
func (MaintenanceArgs) Kind ¶
func (MaintenanceArgs) Kind() string
type MaintenanceJobs ¶
type MaintenanceJobs struct {
// contains filtered or unexported fields
}
func NewMaintenanceJobs ¶
func NewMaintenanceJobs(store *Store) *MaintenanceJobs
func (*MaintenanceJobs) RegisterJobs ¶
func (m *MaintenanceJobs) RegisterJobs(w *river.Workers) []*river.PeriodicJob
type MaintenanceWorker ¶
type MaintenanceWorker struct {
river.WorkerDefaults[MaintenanceArgs]
// contains filtered or unexported fields
}
func NewMaintenanceWorker ¶
func NewMaintenanceWorker(store *Store) *MaintenanceWorker
func (*MaintenanceWorker) Work ¶
func (w *MaintenanceWorker) Work(ctx context.Context, _ *river.Job[MaintenanceArgs]) error
type PermanentError ¶
type PermanentError struct{ Err error }
func (*PermanentError) Error ¶
func (e *PermanentError) Error() string
func (*PermanentError) Permanent ¶
func (e *PermanentError) Permanent() bool
func (*PermanentError) Unwrap ¶
func (e *PermanentError) Unwrap() error
type ReserveRequest ¶
type Schedule ¶
Schedule is snapshotted when a domain first sends through its verified identity. Progress is measured in UTC days that reach the provider-accepted volume threshold, so idle or token sends cannot age into full volume.
func NewSchedule ¶
func (Schedule) CapForActiveDay ¶
CapForActiveDay returns the recipient allowance for a zero-based qualified-day index. The target is reached on the final configured ramp day.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Resolve ¶
Resolve settles a pending reservation from the message's durable provider outcome. It is used by terminal reconciliation after ambiguous worker exits.
Click to show internal directories.
Click to hide internal directories.