Documentation ¶
Index ¶
- type AddressValidator
- type Database
- func (dbase *Database) CountSubscribers(ctx context.Context, status db.SubscriberStatus) (count int64, err error)
- func (dbase *Database) Delete(_ context.Context, email string) error
- func (dbase *Database) Get(_ context.Context, email string) (sub *db.Subscriber, err error)
- func (dbase *Database) ProcessSubscribers(_ context.Context, status db.SubscriberStatus, sp db.SubscriberProcessor) error
- func (dbase *Database) Put(_ context.Context, sub *db.Subscriber) error
- type Mailer
- func (m *Mailer) AssertNoMessageSent(t *testing.T, recipient string)
- func (mailer *Mailer) BulkCapacityAvailable(_ context.Context) error
- func (m *Mailer) GetMessageTo(t *testing.T, recipient string) (msgId, msg string)
- func (m *Mailer) Send(ctx context.Context, recipient string, msg []byte) (messageId string, err error)
- type Suppressor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressValidator ¶
type AddressValidator struct { Email string Failure *email.ValidationFailure Error error }
func NewAddressValidator ¶
func NewAddressValidator() *AddressValidator
func (*AddressValidator) AssertValidated ¶
func (av *AddressValidator) AssertValidated( t *testing.T, expectedEmail string, )
func (*AddressValidator) ValidateAddress ¶
func (av *AddressValidator) ValidateAddress( ctx context.Context, email string, ) (*email.ValidationFailure, error)
type Database ¶
type Database struct { Subscribers []*db.Subscriber SimulateGetErr func(emailAddress string) error SimulatePutErr func(emailAddress string) error SimulateDelErr func(emailAddress string) error SimulateCountErr func(emailAddress string) error SimulateProcSubsErr func(emailAddress string) error Index map[string]*db.Subscriber }
func NewDatabase ¶
func NewDatabase() *Database
func (*Database) CountSubscribers ¶
func (*Database) ProcessSubscribers ¶
func (dbase *Database) ProcessSubscribers( _ context.Context, status db.SubscriberStatus, sp db.SubscriberProcessor, ) error
type Mailer ¶
type Mailer struct { RecipientMessages map[string][]byte MessageIds map[string]string RecipientErrors map[string]error BulkCapError error }
func (*Mailer) AssertNoMessageSent ¶
func (*Mailer) BulkCapacityAvailable ¶
func (*Mailer) GetMessageTo ¶
type Suppressor ¶
type Suppressor struct { Addresses map[string]ops.RemoveReason Errors map[string]error }
func NewSuppressor ¶
func NewSuppressor() *Suppressor
func (*Suppressor) IsSuppressed ¶
func (*Suppressor) Suppress ¶
func (s *Suppressor) Suppress( ctx context.Context, address string, reason ops.RemoveReason) error
func (*Suppressor) Unsuppress ¶
func (s *Suppressor) Unsuppress(ctx context.Context, address string) error
Click to show internal directories.
Click to hide internal directories.