Documentation
¶
Index ¶
- type Client
- func (c *Client) Cmd(s string, isMulti bool, args ...any) (string, error)
- func (c *Client) Dele(ids ...int) error
- func (c *Client) List(id int) ([]MessageID, error)
- func (c *Client) Noop() error
- func (c *Client) Quit() error
- func (c *Client) Retr(id int) (string, error)
- func (c *Client) Rset() error
- func (c *Client) Stat() (count int, size int, err error)
- func (c *Client) Top(id int, numLines int) (string, error)
- func (c *Client) Uidl(id int) ([]MessageID, error)
- type MessageID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
func (*Client) Dele ¶
Dele deletes one or more messages. The server only executes the deletions after a successful Quit().
func (*Client) List ¶
List returns a list of (message ID, message Size) pairs. If the optional id > 0, then only that particular message is listed. The message IDs are sequential, 1 to N.
func (*Client) Noop ¶
Noop issues a do-nothing NOOP command to the server. This is useful for prolonging open connections.
func (*Client) Quit ¶
Quit sends the QUIT command to server and gracefully closes the connection. Message deletions (DELE command) are only excuted by the server on a graceful quit and close.
func (*Client) Retr ¶
Retr downloads a message by the given id and returns the data of the entire message.
func (*Client) Stat ¶
Stat returns the number of messages and their total size in bytes in the inbox.
func (*Client) Top ¶
Top retrieves a message by its ID with full headers and numLines lines of the body.