fakesmtp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

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

Connection of a client with our server

type Server

type Server struct {
	Listener net.Listener
	// contains filtered or unexported fields
}

Server is our fake server that will be listening for SMTP connections.

func New

func New(port string) (*Server, error)

New returns a pointer to a new Server instance listening on the given port.

func (*Server) Clear

func (s *Server) Clear()

Clear the server messages

func (*Server) Handle

func (s *Server) Handle(c *Connection)

Handle a connection from a client

func (*Server) LastMessage

func (s *Server) LastMessage() string

LastMessage returns the last message on the server

func (*Server) Messages

func (s *Server) Messages() []string

Messages returns the list of messages on the server

func (*Server) Start

func (s *Server) Start(port string) error

Start listens for connections on the given port

Jump to

Keyboard shortcuts

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