handlers

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	JobTypeBackupLocal = "job_type_backup_local"
	ScopeDbBackup      = "sqlite_backup"
	StrategyVacuum     = "vacuum"
	StrategyOnline     = "online"
)
View Source
const JobTypeDummy = "job_type_dummy"
View Source
const JobTypeEmailChangeAlert = "job_type_email_change_alert"
View Source
const JobTypeEmailChangeOtp = "job_type_email_change_otp"
View Source
const JobTypeEmailVerificationOtp = "job_type_email_verification_otp"
View Source
const JobTypePasswordResetOtp = "job_type_password_reset_otp"

Variables

This section is empty.

Functions

This section is empty.

Types

type DummyHandler added in v0.11.0

type DummyHandler struct{}

DummyHandler intentionally does nothing. It exists solely to successfully complete JobTypeDummy jobs that are inserted by auth endpoints to defeat timing attacks. By returning nil, the job is safely marked completed and purged.

func NewDummyHandler added in v0.11.0

func NewDummyHandler() *DummyHandler

func (*DummyHandler) Handle added in v0.11.0

func (h *DummyHandler) Handle(ctx context.Context, job db.Job) error

type EmailChangeAlertHandler added in v0.11.0

type EmailChangeAlertHandler struct {
	// contains filtered or unexported fields
}

func NewEmailChangeAlertHandler added in v0.11.0

func NewEmailChangeAlertHandler(mailer mail.MailerInterface) *EmailChangeAlertHandler

func (*EmailChangeAlertHandler) Handle added in v0.11.0

func (h *EmailChangeAlertHandler) Handle(ctx context.Context, job db.Job) error

type EmailChangeOtpHandler added in v0.11.0

type EmailChangeOtpHandler struct {
	// contains filtered or unexported fields
}

func NewEmailChangeOtpHandler added in v0.11.0

func NewEmailChangeOtpHandler(mailer mail.MailerInterface) *EmailChangeOtpHandler

func (*EmailChangeOtpHandler) Handle added in v0.11.0

func (h *EmailChangeOtpHandler) Handle(ctx context.Context, job db.Job) error

type EmailVerificationOtpHandler added in v0.10.0

type EmailVerificationOtpHandler struct {
	// contains filtered or unexported fields
}

EmailVerificationOtpHandler handles sending OTP emails

func NewEmailVerificationOtpHandler added in v0.10.0

func NewEmailVerificationOtpHandler(mailer mail.MailerInterface) *EmailVerificationOtpHandler

NewEmailVerificationOtpHandler creates a new handler

func (*EmailVerificationOtpHandler) Handle added in v0.10.0

func (h *EmailVerificationOtpHandler) Handle(ctx context.Context, job db.Job) error

Handle implements the JobHandler interface

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

Handler handles database backup jobs

func NewHandler

func NewHandler(provider *config.Provider, logger *slog.Logger) *Handler

NewHandler creates a new Handler

func (*Handler) Handle

func (h *Handler) Handle(ctx context.Context, job db.Job) error

Handle implements the JobHandler interface for database backups. It's a wrapper around the testable handle method.

type PasswordResetOtpHandler added in v0.11.0

type PasswordResetOtpHandler struct {
	// contains filtered or unexported fields
}

func NewPasswordResetOtpHandler added in v0.11.0

func NewPasswordResetOtpHandler(mailer mail.MailerInterface) *PasswordResetOtpHandler

func (*PasswordResetOtpHandler) Handle added in v0.11.0

func (h *PasswordResetOtpHandler) Handle(ctx context.Context, job db.Job) error

type PayloadDummy added in v0.11.0

type PayloadDummy struct {
	DummyID string `json:"dummy_id"`
}

PayloadDummy is used for timing equalization jobs. It contains a random ID to ensure that dummy jobs never hit unique constraints intended for real jobs.

type PayloadEmailChangeAlert added in v0.11.0

type PayloadEmailChangeAlert struct {
	OldEmail string `json:"old_email"`
	NewEmail string `json:"new_email"`
}

type PayloadEmailChangeOtp added in v0.11.0

type PayloadEmailChangeOtp struct {
	NewEmail       string `json:"new_email"`
	CooldownBucket int    `json:"cooldown_bucket"`
}

type PayloadEmailChangeOtpExtra added in v0.11.0

type PayloadEmailChangeOtpExtra struct {
	Otp string `json:"otp"`
}

type PayloadEmailVerificationOtp added in v0.10.0

type PayloadEmailVerificationOtp struct {
	Email string `json:"email"`
	// CooldownBucket prevents rapid duplicate requests
	CooldownBucket int `json:"cooldown_bucket"`
}

PayloadEmailVerificationOtp contains the details for deduplicating queued email tasks

type PayloadEmailVerificationOtpExtra added in v0.10.0

type PayloadEmailVerificationOtpExtra struct {
	Otp string `json:"otp"`
}

PayloadEmailVerificationOtpExtra contains the unique OTP code data to act upon

type PayloadPasswordResetOtp added in v0.11.0

type PayloadPasswordResetOtp struct {
	Email          string `json:"email"`
	CooldownBucket int    `json:"cooldown_bucket"`
}

type PayloadPasswordResetOtpExtra added in v0.11.0

type PayloadPasswordResetOtpExtra struct {
	Otp string `json:"otp"`
}

Jump to

Keyboard shortcuts

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