Documentation ¶
Index ¶
- func Context(ctx context.Context, queue *Queue) context.Context
- func EnqueueStd(ctx context.Context, header mail.Header, bodyReader io.Reader, rcptKey *string) error
- func Middleware(queue *Queue) func(next http.Handler) http.Handler
- func NewTask(msg *bytes.Buffer, rcpts []string) *work.Task
- func Send(ctx context.Context, msg io.Reader, rcpts []string) error
- type Queue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnqueueStd ¶
func EnqueueStd(ctx context.Context, header mail.Header, bodyReader io.Reader, rcptKey *string) error
Updates an email with the standard SourceHut headers, signs and optionally encrypts it, and then queues it for delivery.
Senders should fill in at least the To and Subject headers, and the message body. Message-ID, Date, From, and Reply-To will also be added if they are not already present.
func Middleware ¶
Adds HTTP middleware to provide an email work queue to this context.
Types ¶
type Queue ¶
func ForContext ¶
Returns the email worker for this context.
func (*Queue) CanPGPSign ¶
CanPGPSign checks whether emails sent via the queue are signed via OpenPGP.
Click to show internal directories.
Click to hide internal directories.