Versions in this module Expand all Collapse all v1 v1.0.2 Feb 4, 2024 v1.0.1 Jan 16, 2023 v1.0.0 May 29, 2022 Changes in this version + const LabelAllDraft + const LabelAllMail + const LabelAllSent + const LabelArchive + const LabelDraft + const LabelInbox + const LabelSent + const LabelSpam + const LabelStarred + const LabelTrash + const MessagePackageCleartext + const MessagePackageEncryptedOutside + const MessagePackageInlinePGP + const MessagePackageInternal + const MessagePackageMIME + const MessagePackagePGPMIME + const Version + type APIError struct + Code int + Message string + func (err *APIError) Error() string + type Address struct + DisplayName string + DomainID string + Email string + HasKeys int + ID string + Keys []*PrivateKey + Order int64 + Receive int + Send AddressSend + Signature string + Status AddressStatus + Type AddressType + type AddressSend int + const AddressSendDisabled + const AddressSendPrimary + const AddressSendSecondary + type AddressStatus int + const AddressDisabled + const AddressEnabled + type AddressType int + const AddressAlias + const AddressCustom + const AddressOriginal + type Attachment struct + ContentID string + ID string + KeyPackets string + MIMEType string + MessageID string + Name string + Signature string + Size int + func (att *Attachment) Encrypt(ciphertext io.Writer, signed *openpgp.Entity) (cleartext io.WriteCloser, err error) + func (att *Attachment) GenerateKey(to []*openpgp.Entity) (*packet.EncryptedKey, error) + func (att *Attachment) Read(ciphertext io.Reader, keyring openpgp.KeyRing, prompt openpgp.PromptFunction) (*openpgp.MessageDetails, error) + type AttachmentKey struct + Algo string + ID string + Key string + type Auth struct + AccessToken string + EventID string + ExpiresAt time.Time + PasswordMode PasswordMode + RefreshToken string + Scope string + TwoFactor struct{ ... } + UID string + UserID string + type AuthInfo struct + type AuthInfoResp struct + Modulus string + SRPSession string + Salt string + ServerEphemeral string + Version int + func (r *AuthInfoResp) Err() error + type Calendar struct + Color string + Description string + Display int + Flags CalendarFlags + ID string + Name string + type CalendarEvent struct + Author string + CalendarEvents interface{} + CalendarID string + CalendarKeyPacket string + CreateTime Timestamp + ID string + LastEditTime Timestamp + Permissions CalendarEventPermissions + PersonalEvent []CalendarEventCard + SharedEvents []CalendarEventCard + SharedKeyPacket string + type CalendarEventCard struct + Data string + MemberID string + Signature string + Type CalendarEventCardType + type CalendarEventCardType int + type CalendarEventFilter struct + End int64 + Page int + PageSize int + Start int64 + Timezone string + type CalendarEventPermissions int + type CalendarFlags int + type Client struct + AppVersion string + Debug bool + HTTPClient *http.Client + ReAuth func() error + RootURL string + func (c *Client) Auth(username, password string, info *AuthInfo) (*Auth, error) + func (c *Client) AuthInfo(username string) (*AuthInfo, error) + func (c *Client) AuthRefresh(expiredAuth *Auth) (*Auth, error) + func (c *Client) AuthTOTP(code string) (scope string, err error) + func (c *Client) CountMessages(address string) ([]*MessageCount, error) + func (c *Client) CreateAttachment(att *Attachment, r io.Reader) (created *Attachment, err error) + func (c *Client) CreateContacts(contacts []*ContactImport) ([]*CreateContactResp, error) + func (c *Client) CreateDraftMessage(msg *Message, parentID string) (*Message, error) + func (c *Client) DeleteAllContacts() error + func (c *Client) DeleteContacts(ids []string) ([]*DeleteContactResp, error) + func (c *Client) DeleteMessages(ids []string) error + func (c *Client) GetAttachment(id string) (io.ReadCloser, error) + func (c *Client) GetContact(id string) (*Contact, error) + func (c *Client) GetConversation(id, msgID string) (*Conversation, []*Message, error) + func (c *Client) GetCurrentUser() (*User, error) + func (c *Client) GetEvent(last string) (*Event, error) + func (c *Client) GetMessage(id string) (*Message, error) + func (c *Client) GetPublicKeys(email string) (*PublicKeyResp, error) + func (c *Client) Import(metadata map[string]*Message) (*Importer, error) + func (c *Client) LabelMessages(labelID string, ids []string) error + func (c *Client) ListAddresses() ([]*Address, error) + func (c *Client) ListCalendarEvents(calendarID string, filter *CalendarEventFilter) ([]*CalendarEvent, error) + func (c *Client) ListCalendars(page, pageSize int) ([]*Calendar, error) + func (c *Client) ListContacts(page, pageSize int) (total int, contacts []*Contact, err error) + func (c *Client) ListContactsEmails(page, pageSize int) (total int, emails []*ContactEmail, err error) + func (c *Client) ListContactsExport(page, pageSize int) (total int, contacts []*ContactExport, err error) + func (c *Client) ListKeySalts() (map[string][]byte, error) + func (c *Client) ListLabels() ([]*Label, error) + func (c *Client) ListMessages(filter *MessageFilter) (total int, messages []*Message, err error) + func (c *Client) Logout() error + func (c *Client) MarkMessagesRead(ids []string) error + func (c *Client) MarkMessagesUnread(ids []string) error + func (c *Client) SendMessage(msg *OutgoingMessage) (sent, parent *Message, err error) + func (c *Client) UndeleteMessages(ids []string) error + func (c *Client) UnlabelMessages(labelID string, ids []string) error + func (c *Client) Unlock(auth *Auth, keySalts map[string][]byte, passphrase string) (openpgp.EntityList, error) + func (c *Client) UpdateContact(id string, contact *ContactImport) (*Contact, error) + func (c *Client) UpdateDraftMessage(msg *Message) (*Message, error) + type Contact struct + Cards []*ContactCard + ContactEmails []*ContactEmail + CreateTime Timestamp + ID string + LabelIDs []string + ModifyTime Timestamp + Name string + Size int + UID string + type ContactCard struct + Data string + Signature string + Type ContactCardType + func NewEncryptedContactCard(r io.Reader, to []*openpgp.Entity, signer *openpgp.Entity) (*ContactCard, error) + func NewSignedContactCard(r io.Reader, signer *openpgp.Entity) (*ContactCard, error) + func (card *ContactCard) Read(keyring openpgp.KeyRing) (*openpgp.MessageDetails, error) + type ContactCardType int + const ContactCardCleartext + const ContactCardEncrypted + const ContactCardEncryptedAndSigned + const ContactCardSigned + func (t ContactCardType) Encrypted() bool + func (t ContactCardType) Signed() bool + type ContactEmail struct + ContactID string + Defaults ContactEmailDefaults + Email string + ID string + LabelIDs []string + Name string + Order int + Type []string + type ContactEmailDefaults int + type ContactExport struct + Cards []*ContactCard + ID string + type ContactImport struct + Cards []*ContactCard + type Conversation struct + AddressID string + ExpirationTime Timestamp + ID string + LabelIDs []string + NumAttachments int + NumMessages int + NumUnread int + Order int64 + Recipients []*MessageAddress + Senders []*MessageAddress + Subject string + TotalSize int64 + type CreateContactResp struct + Index int + Response struct{ ... } + func (resp *CreateContactResp) Err() error + type DeleteContactResp struct + ID string + Response struct{} + func (resp *DeleteContactResp) Err() error + type Event struct + Contacts []*EventContact + ID string + MessageCounts []*MessageCount + Messages []*EventMessage + Notices []string + Refresh EventRefresh + type EventAction int + const EventCreate + const EventDelete + const EventUpdate + const EventUpdateFlags + type EventContact struct + Action EventAction + Contact *Contact + ID string + type EventMessage struct + Action EventAction + Created *Message + ID string + Updated *EventMessageUpdate + func (em *EventMessage) UnmarshalJSON(b []byte) error + type EventMessageUpdate struct + IsForwarded *int + IsReplied *int + IsRepliedAll *int + LabelIDs []string + LabelIDsAdded []string + LabelIDsRemoved []string + Time Timestamp + Type *MessageType + Unread *int + func (update *EventMessageUpdate) DiffLabelIDs(current []string) (added, removed []string) + func (update *EventMessageUpdate) Patch(msg *Message) + type EventRefresh int + const EventRefreshContacts + const EventRefreshMail + type ImportMessageResult struct + Err error + MessageID string + type ImportResult map[string]ImportMessageResult + func (res ImportResult) Err() error + type Importer struct + func (imp *Importer) Commit() (ImportResult, error) + func (imp *Importer) ImportMessage(key string) (io.Writer, error) + type Label struct + Color string + Display int + Exclusive int + ID string + Name string + Notify int + Order int + Type LabelType + type LabelType int + const LabelContact + const LabelMessage + type Message struct + AddressID string + Attachments []*Attachment + BCCList []*MessageAddress + Body string + CCList []*MessageAddress + ConversationID string + ExpirationTime Timestamp + ExternalID string + Header string + ID string + IsEncrypted MessageEncryption + IsForwarded int + IsReplied int + IsRepliedAll int + LabelIDs []string + MIMEType string + NumAttachments int + Order int64 + ReplyTos []*MessageAddress + Sender *MessageAddress + Size int64 + SpamScore int + Subject string + Time Timestamp + ToList []*MessageAddress + Type MessageType + Unread int + func (msg *Message) Encrypt(to []*openpgp.Entity, signed *openpgp.Entity) (plaintext io.WriteCloser, err error) + func (msg *Message) Read(keyring openpgp.KeyRing, prompt openpgp.PromptFunction) (*openpgp.MessageDetails, error) + type MessageAction int + const MessageForward + const MessageReply + const MessageReplyAll + type MessageAddress struct + Address string + Name string + type MessageCount struct + LabelID string + Total int + Unread int + type MessageEncryption int + const MessageEncryptedExternal + const MessageEncryptedInlinePGP + const MessageEncryptedInternal + const MessageEncryptedOutside + const MessageEncryptedPGPMIME + const MessageUnencrypted + type MessageFilter struct + AddressID string + Asc bool + Attachments *bool + Begin int64 + Conversation string + End int64 + ExternalID string + From string + ID []string + Keyword string + Label string + Limit int + Page int + PageSize int + Sort string + Starred *bool + Subject string + To string + Unread *bool + type MessageKeyPacket struct + ID string + KeyPackets string + type MessagePackage struct + AttachmentKeyPackets map[string]string + Auth interface{} + BodyKeyPacket string + EncToken string + PasswordHint string + Signature int + Token string + Type MessagePackageType + type MessagePackageSet struct + Addresses map[string]*MessagePackage + AttachmentKeys map[string]*PackedKey + Body string + BodyKey *PackedKey + MIMEType string + Type MessagePackageType + func NewMessagePackageSet(attachmentKeys map[string]*packet.EncryptedKey) *MessagePackageSet + func (set *MessagePackageSet) AddCleartext(addr string) (*MessagePackage, error) + func (set *MessagePackageSet) AddInternal(addr string, pub *openpgp.Entity) (*MessagePackage, error) + func (set *MessagePackageSet) Encrypt(mimeType string, signed *openpgp.Entity) (io.WriteCloser, error) + type MessagePackageType int + type MessageType int + const MessageDraft + const MessageInbox + const MessageInboxAndSent + const MessageSent + type OutgoingMessage struct + ExpirationTime int + ID string + Packages []*MessagePackageSet + type PackedKey struct + Algorithm string + Key string + type PasswordMode int + const PasswordSingle + const PasswordTwo + type PrivateKey struct + Active int + Fingerprint string + Flags PrivateKeyFlags + ID string + Primary int + PrivateKey string + Signature string + Token string + Version int + func (priv *PrivateKey) Entity() (*openpgp.Entity, error) + type PrivateKeyFlags int + const PrivateKeyEncrypt + const PrivateKeyVerify + type PublicKey struct + PublicKey string + Send int + func (pub *PublicKey) Entity() (*openpgp.Entity, error) + type PublicKeyResp struct + Keys []*PublicKey + MIMEType string + RecipientType RecipientType + type RawAPIError struct + Message string + type RecipientType int + const RecipientExternal + const RecipientInternal + type Timestamp int64 + func (t Timestamp) Time() time.Time + type User struct + Credit int + Currency string + Delinquent int + ID string + Keys []*PrivateKey + MaxSpace int64 + MaxUpload int + Name string + Private int + Role int + Services int + Subscribed int + UsedSpace int64