Documentation
¶
Overview ¶
Package imaptest runs go-imap's in-memory IMAP server over TLS for integration tests.
Index ¶
Constants ¶
View Source
const ( Username = "me@example.test" Password = "app-pass-wxyz-1234" // #nosec G101 -- exists only on the in-memory test server )
The one account on the test server.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Server ¶
type Server struct {
Host string
Port int
TLS *tls.Config // client config that trusts the server's certificate
User *imapmemserver.User // create folders and inspect state directly
// contains filtered or unexported fields
}
Server is a running in-memory IMAP server with one user and an INBOX.
func Start ¶
Start serves until the test ends. caps is what the server advertises; nil means plain IMAP4rev1 (which still includes IDLE, but neither MOVE nor UIDPLUS).
func (*Server) KillConnections ¶
func (s *Server) KillConnections()
KillConnections cuts every open connection, as a network drop would.
func (*Server) RefuseCreate ¶
RefuseCreate makes the server answer CREATE with NO, as a server that does not let a client make folders would, until it is called with false.
Click to show internal directories.
Click to hide internal directories.