Documentation
¶
Overview ¶
Package pop3 provides simple POP3 client.
Index ¶
Constants ¶
View Source
const ( // CommandDelete is a command to delete message from POP3 server. CommandDelete = "DELE" // CommandList is a command to get list of messages from POP3 server. CommandList = "LIST" // CommandNoop is a ping-like command that tells POP3 to do nothing. // (i.e. send something line pong-response). CommandNoop = "NOOP" // CommandPassword is a command to send user password to POP3 server. CommandPassword = "PASS" // CommandQuit is a command to tell POP3 server that you are quitting. CommandQuit = "QUIT" // CommandRetrieve is a command to retrieve POP3 message from server. CommandRetrieve = "RETR" // CommandUser is a command to send user login to POP3 server. CommandUser = "USER" )
Variables ¶
View Source
var ( // ErrAlreadyQuit is an error that is returned when an attempt to // write is made after the "QUIT" command is sent. ErrAlreadyQuit = fmt.Errorf("pop3: already quit from server") // ErrWriteAfterClose is an error that is returned when an attempt // to write is made after the connection is closed. ErrWriteAfterClose = fmt.Errorf("pop3: write after close") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Reader is a pointer to a textproto.Reader struct. Reader *textproto.Reader // Writer is a pointer to a textproto.Writer struct. Writer *textproto.Writer // contains filtered or unexported fields }
Client is a POP3 client.
func NewClient ¶
func NewClient(conn io.ReadWriteCloser) (c *Client, err error)
NewClient creates a new POP3 client.
func (*Client) GetMessages ¶
GetMessages requests messages lists from POP3 server.
func (*Client) NoOperation ¶
NoOperation sends ping-like request to the POP3-server.
type Error ¶
type Error struct { // Context is context where an error happend. Context string // Err is an error. Err error }
Error is a POP3 error.
type LineReader ¶
type LineReader interface { // ReadLine reads a single line from reader. ReadLine() (line string, err error) }
LineReader is an interface that has a ReadLine method.
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
Message is a struct that helps working with POP3 messages.
Click to show internal directories.
Click to hide internal directories.