responses

package
v1.99.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

IMAP responses defined in RFC 3501.

Index

Constants

This section is empty.

Variables

View Source
var ErrUnhandled = errors.New("imap: unhandled response")

ErrUnhandled is used when a response hasn't been handled.

Functions

This section is empty.

Types

type Authenticate

type Authenticate struct {
	Mechanism       sasl.Client
	InitialResponse []byte
	RepliesCh       chan []byte
}

An AUTHENTICATE response.

func (*Authenticate) Handle

func (r *Authenticate) Handle(resp imap.Resp) error

func (*Authenticate) Replies

func (r *Authenticate) Replies() <-chan []byte

Implements

type Capability

type Capability struct {
	Caps []string
}

A CAPABILITY response. See RFC 3501 section 7.2.1

func (*Capability) WriteTo

func (r *Capability) WriteTo(w *imap.Writer) error

type Enabled

type Enabled struct {
	Caps []string
}

An ENABLED response, defined in RFC 5161 section 3.2.

func (*Enabled) Handle

func (r *Enabled) Handle(resp imap.Resp) error

func (*Enabled) WriteTo

func (r *Enabled) WriteTo(w *imap.Writer) error

type Expunge

type Expunge struct {
	SeqNums chan uint32
}

An EXPUNGE response. See RFC 3501 section 7.4.1

func (*Expunge) Handle

func (r *Expunge) Handle(resp imap.Resp) error

func (*Expunge) WriteTo

func (r *Expunge) WriteTo(w *imap.Writer) error

type Fetch

type Fetch struct {
	Messages chan *imap.Message
	SeqSet   *imap.SeqSet
	Uid      bool
}

A FETCH response. See RFC 3501 section 7.4.2

func (*Fetch) Handle

func (r *Fetch) Handle(resp imap.Resp) error

func (*Fetch) WriteTo

func (r *Fetch) WriteTo(w *imap.Writer) error

type Handler

type Handler interface {
	// Handle processes a response. If the response cannot be processed,
	// ErrUnhandledResp must be returned.
	Handle(resp imap.Resp) error
}

Handler handles responses.

type HandlerFunc

type HandlerFunc func(resp imap.Resp) error

HandlerFunc is a function that handles responses.

func (HandlerFunc) Handle

func (f HandlerFunc) Handle(resp imap.Resp) error

Handle implements Handler.

type Idle

type Idle struct {
	RepliesCh chan []byte
	Stop      <-chan struct{}
	// contains filtered or unexported fields
}

An IDLE response.

func (*Idle) Handle

func (r *Idle) Handle(resp imap.Resp) error

func (*Idle) Replies

func (r *Idle) Replies() <-chan []byte

type List

type List struct {
	Mailboxes  chan *imap.MailboxInfo
	Subscribed bool
}

A LIST response. If Subscribed is set to true, LSUB will be used instead. See RFC 3501 section 7.2.2

func (*List) Handle

func (r *List) Handle(resp imap.Resp) error

func (*List) Name

func (r *List) Name() string

func (*List) WriteTo

func (r *List) WriteTo(w *imap.Writer) error

type Replier

type Replier interface {
	Handler
	Replies() <-chan []byte
}

Replier is a Handler that needs to send raw data (for instance AUTHENTICATE).

type Search struct {
	Ids []uint32
}

A SEARCH response. See RFC 3501 section 7.2.5

func (*Search) Handle

func (r *Search) Handle(resp imap.Resp) error

func (*Search) WriteTo

func (r *Search) WriteTo(w *imap.Writer) (err error)

type Select

type Select struct {
	Mailbox *imap.MailboxStatus
}

A SELECT response.

func (*Select) Handle

func (r *Select) Handle(resp imap.Resp) error

func (*Select) WriteTo

func (r *Select) WriteTo(w *imap.Writer) error

type Status

type Status struct {
	Mailbox *imap.MailboxStatus
}

A STATUS response. See RFC 3501 section 7.2.4

func (*Status) Handle

func (r *Status) Handle(resp imap.Resp) error

func (*Status) WriteTo

func (r *Status) WriteTo(w *imap.Writer) error

Jump to

Keyboard shortcuts

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