id

package module
v0.0.0-...-f94a56b Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: MIT Imports: 5 Imported by: 0

README

go-imap-id

GoDoc

The IMAP ID Extension for go-imap.

License

MIT

Documentation

Overview

Implements the IMAP ID Extension, defined in RFC 2971.

Index

Constants

View Source
const (
	// Name of the program.
	FieldName = "name"
	// Version number of the program
	FieldVersion = "version"
	// Name of the operating system.
	FieldOS = "os"
	// Version of the operating system.
	FieldOSVersion = "os-version"
	// Vendor of the client/server.
	FieldVendor = "vendor"
	// URL to contact for support.
	FieldSupportURL = "support-url"
	// Postal address of contact/vendor.
	FieldAddress = "address"
	// Date program was released, specified as a date-time in IMAP4rev1.
	FieldDate = "date"
	// Command used to start the program.
	FieldCommand = "command"
	// Arguments supplied on the command line, if any.
	FieldArguments = "arguments"
	// Description of environment, i.e., UNIX environment variables or Windows
	// registry settings.
	FieldEnvironment = "environment"
)

Fields used in Id.

View Source
const Capability = "ID"

The ID capability.

Variables

This section is empty.

Functions

func NewExtension

func NewExtension(serverID ID) server.Extension

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an ID client.

func NewClient

func NewClient(c *client.Client) *Client

NewClient creates a new client.

func (*Client) ID

func (c *Client) ID(clientID ID) (serverID ID, err error)

ID sends an ID command to the server and returns the server's ID.

func (*Client) SupportID

func (c *Client) SupportID() (bool, error)

SupportID checks if the server supports the ID extension.

type Command

type Command struct {
	ID ID
}

An ID command. See RFC 2971 section 3.1.

func (*Command) Command

func (cmd *Command) Command() *imap.Command

func (*Command) Parse

func (cmd *Command) Parse(fields []interface{}) (err error)

type Conn

type Conn interface {
	ID() ID
	// contains filtered or unexported methods
}

type Handler

type Handler struct {
	Command
	// contains filtered or unexported fields
}

func (*Handler) Handle

func (hdlr *Handler) Handle(conn server.Conn) error

type ID

type ID map[string]string

Fields identifying a client or a server. Keys MUST NOT be longer than 30 bytes, values MUST NOT be longer than 1024 bytes. The number of fields MUST NOT be greater than 30.

type Response

type Response struct {
	ID ID
}

An ID response. See RFC 2971 section 3.2.

func (*Response) Handle

func (r *Response) Handle(resp imap.Resp) (err error)

func (*Response) Parse

func (r *Response) Parse(fields []interface{}) (err error)

func (*Response) WriteTo

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

Jump to

Keyboard shortcuts

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