Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SMTPServer ¶
type SMTPServer struct { // MailBox is the slice that stores all messages that have arrived to // the server while it's listening. Use the mutex to access it, or bad // things can happen. MailBox []Mail sync.RWMutex // contains filtered or unexported fields }
SMTPServer is a fake SMTP server implementation.
This SMTP server does not support authentication and is supposed to be used in tests only.
Use NewSMTPServer create a new instance and start serving; SMTPServer.Addr() will get you the address of the server and Stop will stop the server, closing the listener. Every message that arrive at the server is stored in the MailBox slice.
func NewSMTPServer ¶
func NewSMTPServer() (*SMTPServer, error)
NewSMTPServer creates a new SMTP server, for testing purposes.
func (*SMTPServer) Addr ¶
func (s *SMTPServer) Addr() string
Addr returns the address of the server, in the form <host>:<port>.
func (*SMTPServer) Reset ¶
func (s *SMTPServer) Reset()
Reset resets the server, cleaning up the mailbox.
func (*SMTPServer) Stop ¶
func (s *SMTPServer) Stop()
Stop stops the server. It's safe to call this method multiple times.