bolt

package
v5.0.0-...-b98a0e9 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBoltDAO

func NewBoltDAO(db boltdb.DB) mailer2.Queue

Types

type BoltQueue

type BoltQueue struct {
	boltdb.DB
}

BoltQueue defines a queue for the mails backed by a Bolt DB.

func (*BoltQueue) Close

func (b *BoltQueue) Close(ctx context.Context) error

Close closes the DB and delete corresponding file if deleteOnClose flag as been set on creation.

func (*BoltQueue) Consume

func (b *BoltQueue) Consume(ctx context.Context, sendHandler func(email *mailer.Mail) error) error

Consume acquires the lock and send mails that are in the queue by batches, sending at most 100 mails by batch.

func (*BoltQueue) Init

func (b *BoltQueue) Init(ctx context.Context) error

func (*BoltQueue) Push

func (b *BoltQueue) Push(ctx context.Context, email *mailer.Mail) error

Push acquires the lock and add a mail to be sent in the queue.

Jump to

Keyboard shortcuts

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