mock

package
v0.0.0-...-fb80ee1 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CircuitBreakerTimer

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

CircuitBreakerTimer is a mock implementation of mailspree.CircuitBreakerTimer

func NewCircuitBreakerTimer

func NewCircuitBreakerTimer() *CircuitBreakerTimer

func (*CircuitBreakerTimer) EndTimer

func (t *CircuitBreakerTimer) EndTimer()

EndTimer sends a signal that the timer has ended.

func (*CircuitBreakerTimer) Run

func (t *CircuitBreakerTimer) Run() <-chan int

Run returns a channel and it also sets it in the CircuitBreakerTimer struct, so that the timer can be ended using EndTimer.

type MailingProvider

type MailingProvider struct {
	SentEmail   []mailspree.Message
	TriedToSend []mailspree.Message
	Fail        bool
}

MailingProvider is a mailing provider mock. It stores sent mail in a slice so that we can check if it is called. It can be set to fail by setting the Fail field to true.

func (*MailingProvider) SendEmail

func (mp *MailingProvider) SendEmail(m mailspree.Message) error

SendEmail adds the email to a slice for later inspection. If the Fail field is set, the email is not added, and we just fail.

Jump to

Keyboard shortcuts

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