Documentation ¶
Index ¶
- Constants
- Variables
- type Conn
- func (c *Conn) Close() error
- func (c *Conn) ReadFixedLength(length int) (data []byte, err error)
- func (c *Conn) ReadLine() (text string, ok bool)
- func (c *Conn) SetReadOnly()
- func (c *Conn) SetReadWrite()
- func (c *Conn) SetState(state connState)
- func (c *Conn) Start() error
- func (c *Conn) Write(p []byte) (n int, err error)
Constants ¶
const ( // StateNew is the initial state of a client connection; before a welcome // message is sent. StateNew connState = iota // StateNotAuthenticated is when a welcome message has been sent but hasn't // yet authenticated. StateNotAuthenticated // StateAuthenticated is when a client has successfully authenticated but // not yet selected a mailbox. StateAuthenticated // StateSelected is when a client has successfully selected a mailbox. StateSelected // StateLoggedOut is when a client has disconnected from the server. StateLoggedOut )
Variables ¶
var ErrUnrecognisedParameter = errors.New("Unrecognised Parameter")
ErrUnrecognisedParameter indicates that the parameter requested in a FETCH command is unrecognised or not implemented in this IMAP server
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct { Rwc io.ReadWriteCloser RwcScanner *bufio.Scanner // Provides an interface for scanning lines from the connection Transcript io.Writer Mailstore mailstore.Mailstore // Pointer to the IMAP server's mailstore to which this connection belongs User mailstore.User SelectedMailbox mailstore.Mailbox // contains filtered or unexported fields }
Conn represents a client connection to the IMAP server
func NewConn ¶
func NewConn(mailstore mailstore.Mailstore, netConn io.ReadWriteCloser, transcript io.Writer) (c *Conn)
NewConn creates a new client connection. It's intended to be directly used with a network connection. The transcript logs all client/server interactions and is very useful while debugging.
func (*Conn) ReadFixedLength ¶
ReadFixedLength reads data from the connection up to the specified length.
func (*Conn) SetReadOnly ¶
func (c *Conn) SetReadOnly()
SetReadOnly sets the client connection as read-only. It forbids any operations that may modify data.
func (*Conn) SetReadWrite ¶
func (c *Conn) SetReadWrite()
SetReadWrite sets the connection as read-write.
func (*Conn) SetState ¶
func (c *Conn) SetState(state connState)
SetState sets the state that an IMAP client is in. It also resets any mailbox write access.
Source Files ¶
- command_append.go
- command_authenticate.go
- command_capability.go
- command_close.go
- command_copy.go
- command_examine.go
- command_expunge.go
- command_fetch.go
- command_list.go
- command_login.go
- command_logout.go
- command_lsub.go
- command_noop.go
- command_select.go
- command_status.go
- command_store.go
- commands.go
- conn.go