Categorygithub.com/emersion/go-imap-quota
modulepackage
0.0.0-20210203125329-619074823f3c
Repository: https://github.com/emersion/go-imap-quota.git
Documentation: pkg.go.dev

# README

go-imap-quota

GoDoc

QUOTA extension for go-imap

Usage

package main

import (
	"log"

	"github.com/emersion/go-imap-quota"
)

func main() {
	// Connect to IMAP server

	// Create a quota client
	qc := quota.NewClient(c)

	// Check for server support
	if !qc.SupportsQuota() {
		log.Fatal("Client doesn't support QUOTA extension")
	}

	// Retrieve quotas for INBOX
	quotas, err := qc.GetQuotaRoot("INBOX")
	if err != nil {
		log.Fatal(err)
	}

	// Print quotas
	log.Println("Quotas for INBOX:")
	for _, quota := range quotas {
		log.Printf("* %q, resources:\n", quota.Name)
		for name, usage := range quota.Resources {
			log.Printf("  * %v: %v/%v used\n", name, usage[0], usage[1])
		}
	}
}

License

MIT

# Functions

NewClient creates a new client.
No description provided by the author

# Constants

The QUOTA capability name.
Number of messages.
Sum of messages' RFC822.SIZE, in units of 1024 octets.

# Variables

No description provided by the author

# Structs

Client is a QUOTA client.
The GETQUOTA command.
No description provided by the author
The GETQUOTAROOT command.
No description provided by the author
No description provided by the author
A QUOTA response.
A QUOTAROOT response.
The SETQUOTA command.
No description provided by the author
A quota status.

# Interfaces

No description provided by the author
No description provided by the author