service

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package service coordinates mailbox workflows across repositories, providers, and blob storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesReader

func BytesReader(value []byte) io.Reader

BytesReader is retained for provider fakes and streaming tests.

func SafeFilename

func SafeFilename(filename string) string

SafeFilename creates a display-only fallback and never participates in a storage path.

Types

type Mailbox

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

Mailbox owns recoverable application workflows.

func NewMailbox

func NewMailbox(cfg config.Config, repo *repository.Repository, store blobstore.Store, client provider.Client) *Mailbox

NewMailbox creates a mailbox service.

func (*Mailbox) ApplyConfig added in v0.3.1

func (s *Mailbox) ApplyConfig(cfg config.Config)

ApplyConfig updates settings that are safe to reload while the process runs.

func (*Mailbox) Ingest

func (s *Mailbox) Ingest(ctx context.Context, webhookEventID, resendEmailID string, bestEffort bool) error

Ingest retrieves, archives, sanitizes, indexes, and threads one received email.

func (*Mailbox) JobHandlers

func (s *Mailbox) JobHandlers() map[string]jobs.Handler

JobHandlers returns every supported durable work kind.

func (*Mailbox) Send

func (s *Mailbox) Send(ctx context.Context, messageID string) error

Send submits one queued message with stable application and provider idempotency.

func (*Mailbox) SendDigest added in v0.3.1

func (s *Mailbox) SendDigest(ctx context.Context, subscriptionID string, since, until time.Time) error

SendDigest sends a metadata-only summary to the recipient configured by the user. It deliberately excludes subjects, senders, and message bodies.

func (*Mailbox) SendDigestPreview added in v0.4.1

func (s *Mailbox) SendDigestPreview(ctx context.Context, sub model.DigestSubscription, since, until time.Time) error

SendDigestPreview sends the same metadata-only report immediately without changing the subscription schedule or last successful delivery timestamp.

type SafeError

type SafeError struct {
	Message   string
	Temporary bool
	Cause     error
}

SafeError separates administrator-safe context from detailed structured logs.

func (*SafeError) Error

func (e *SafeError) Error() string

func (*SafeError) SafeMessage

func (e *SafeError) SafeMessage() string

func (*SafeError) Unwrap

func (e *SafeError) Unwrap() error

Jump to

Keyboard shortcuts

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