Documentation ¶
Overview ¶
Implements the IMAP QUOTA extension, as defined in RFC 2087.
Index ¶
Constants ¶
View Source
const ( // Sum of messages' RFC822.SIZE, in units of 1024 octets ResourceStorage = "STORAGE" // Number of messages ResourceMessage = "MESSAGE" )
Resources defined in RFC 2087 section 3.
View Source
const Capability = "QUOTA"
The QUOTA capability name.
Variables ¶
View Source
var (
ErrUnsupportedBackend = errors.New("quota: backend not supported")
)
Functions ¶
func NewExtension ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a QUOTA client.
func (*Client) GetQuotaRoot ¶
GetQuotaRoot returns the list of quota roots for a mailbox.
func (*Client) SetQuota ¶
SetQuota changes the resource limits for the specified quota root. Any previous resource limits for the named quota root are discarded.
func (*Client) SupportQuota ¶
SupportQuota checks if the server supports the QUOTA extension.
type GetCommand ¶
type GetCommand struct {
Root string
}
The GETQUOTA command. See RFC 2087 section 4.2.
func (*GetCommand) Command ¶
func (cmd *GetCommand) Command() *imap.Command
func (*GetCommand) Parse ¶
func (cmd *GetCommand) Parse(fields []interface{}) error
type GetHandler ¶
type GetHandler struct {
GetCommand
}
type GetRootCommand ¶
type GetRootCommand struct {
Mailbox string
}
The GETQUOTAROOT command. See RFC 2087 section 4.3.
func (*GetRootCommand) Command ¶
func (cmd *GetRootCommand) Command() *imap.Command
func (*GetRootCommand) Parse ¶
func (cmd *GetRootCommand) Parse(fields []interface{}) error
type GetRootHandler ¶
type GetRootHandler struct {
GetRootCommand
}
type MailboxRoots ¶
func (*MailboxRoots) Format ¶
func (m *MailboxRoots) Format() (fields []interface{})
func (*MailboxRoots) Parse ¶
func (m *MailboxRoots) Parse(fields []interface{}) error
type Response ¶
type Response struct {
Quotas []*Status
}
A QUOTA response. See RFC 2087 section 5.1.
type RootResponse ¶
type RootResponse struct {
Mailbox *MailboxRoots
}
A QUOTAROOT response. See RFC 2087 section 5.1.
func (*RootResponse) Handle ¶
func (r *RootResponse) Handle(resp imap.Resp) error
func (*RootResponse) WriteTo ¶
func (r *RootResponse) WriteTo(w *imap.Writer) (err error)
type SetCommand ¶
The SETQUOTA command. See RFC 2087 section 4.1.
func (*SetCommand) Command ¶
func (cmd *SetCommand) Command() *imap.Command
func (*SetCommand) Parse ¶
func (cmd *SetCommand) Parse(fields []interface{}) error
type SetHandler ¶
type SetHandler struct {
SetCommand
}
type Status ¶
type Status struct { // The quota name. Name string // The quota resources. Each resource is indexed by its name and contains its // current usage as well as its limit. Resources map[string][2]uint32 }
A quota status.
type User ¶
type User interface { // GetQuota returns the quota with the specified name. GetQuota(name string) (*Status, error) // SetQuota registers or updates a quota for this user with a set of resources // and their limit. The resource limits for the named quota root are changed // to be the specified limits. Any previous resource limits for the named // quota root are discarded. SetQuota(name string, resources map[string]uint32) error }
Click to show internal directories.
Click to hide internal directories.