conn

package
v0.0.0-...-1e29585 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateNew connState = iota
	StateNotAuthenticated
	StateAuthenticated
	StateSelected
	StateLoggedOut
)

Variables

View Source
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)

func (*Conn) Close

func (c *Conn) Close() error

Close forces the server to close the client's connection

func (*Conn) ReadFixedLength

func (c *Conn) ReadFixedLength(length int) (data []byte, err error)

Reads data from the connection up to the length specified

func (*Conn) ReadLine

func (c *Conn) ReadLine() (text string, ok bool)

ReadLine awaits a single line from the client

func (*Conn) SetReadOnly

func (c *Conn) SetReadOnly()

func (*Conn) SetReadWrite

func (c *Conn) SetReadWrite()

func (*Conn) SetState

func (c *Conn) SetState(state connState)

func (*Conn) Start

func (c *Conn) Start() error

Start tells the server to start communicating with the client (after the connection has been opened)

func (*Conn) Write

func (c *Conn) Write(p []byte) (n int, err error)

type WriteMode

type WriteMode bool
const (
	ReadOnly  WriteMode = false
	ReadWrite           = true
)

Jump to

Keyboard shortcuts

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