Documentation ¶
Overview ¶
Package proton implements types for accessing the Proton API.
Index ¶
- Constants
- Variables
- func BuildRFC822(kr *crypto.KeyRing, msg Message, attData map[string][]byte) ([]byte, error)
- func ClientIDFromContext(ctx context.Context) (uint64, bool)
- func DecodeKeyPacket(packet string) []byte
- func EncryptRFC822(kr *crypto.KeyRing, literal []byte) ([]byte, error)
- func InsecureTransport() *http.Transport
- func NewDropConn(c net.Conn, l *Listener) net.Conn
- func NewHangConn(c net.Conn, l *Listener) net.Conn
- func Unlock(user User, addresses []Address, saltedKeyPass []byte) (*crypto.KeyRing, map[string]*crypto.KeyRing, error)
- func WithClient(parent context.Context, clientID uint64) context.Context
- type APIBool
- type APIError
- type Address
- type AddressEvent
- type AddressStatus
- type Attachment
- type AttachmentAllocator
- type Attributes
- type Auth
- type Auth2FAReq
- type AuthHandler
- type AuthInfo
- type AuthInfoReq
- type AuthModulus
- type AuthRefreshReq
- type AuthReq
- type AuthSession
- type AuthVerifier
- type Block
- type Bool
- type Calendar
- type CalendarAttendee
- type CalendarAttendeeStatus
- type CalendarEvent
- type CalendarEventPart
- type CalendarEventType
- type CalendarFlag
- type CalendarKey
- type CalendarKeyFlag
- type CalendarKeys
- type CalendarMember
- type CalendarPassphrase
- type CalendarPassphraseFlag
- type CalendarPermissions
- type CalendarType
- type Card
- func (c *Card) ChangeType(kr *crypto.KeyRing, cardType CardType) error
- func (c *Card) DeleteGroup(kr *crypto.KeyRing, groupKey, groupValue string) error
- func (c Card) Get(kr *crypto.KeyRing, key string) ([]*vcard.Field, error)
- func (c Card) GetGroup(kr *crypto.KeyRing, groupKey, groupValue string) (CardGroup, error)
- func (c *Card) Set(kr *crypto.KeyRing, key, value string) error
- type CardGroup
- type CardType
- type Cards
- type Client
- func (c *Client) AddAuthHandler(handler AuthHandler)
- func (c *Client) AddDeauthHandler(handler Handler)
- func (c *Client) AddPostRequestHook(hook resty.ResponseMiddleware)
- func (c *Client) AddPreRequestHook(hook resty.RequestMiddleware)
- func (c *Client) Auth2FA(ctx context.Context, req Auth2FAReq) error
- func (c *Client) AuthDelete(ctx context.Context) error
- func (c *Client) AuthRevoke(ctx context.Context, authUID string) error
- func (c *Client) AuthRevokeAll(ctx context.Context) error
- func (c *Client) AuthSessions(ctx context.Context) ([]AuthSession, error)
- func (c *Client) Close()
- func (c *Client) CountCalendarEvents(ctx context.Context, calendarID string) (int, error)
- func (c *Client) CountContactEmails(ctx context.Context, email string) (int, error)
- func (c *Client) CountContacts(ctx context.Context) (int, error)
- func (c *Client) CountMessages(ctx context.Context) (int, error)
- func (c *Client) CreateAddressKey(ctx context.Context, req CreateAddressKeyReq) (Key, error)
- func (c *Client) CreateContacts(ctx context.Context, req CreateContactsReq) ([]CreateContactsRes, error)
- func (c *Client) CreateDraft(ctx context.Context, addrKR *crypto.KeyRing, req CreateDraftReq) (Message, error)
- func (c *Client) CreateLabel(ctx context.Context, req CreateLabelReq) (Label, error)
- func (c *Client) CreateLegacyAddressKey(ctx context.Context, req CreateAddressKeyReq) (Key, error)
- func (c *Client) DeleteAddress(ctx context.Context, addressID string) error
- func (c *Client) DeleteAddressKey(ctx context.Context, keyID string, keyList KeyList) error
- func (c *Client) DeleteContacts(ctx context.Context, req DeleteContactsReq) error
- func (c *Client) DeleteLabel(ctx context.Context, labelID string) error
- func (c *Client) DeleteMessage(ctx context.Context, messageIDs ...string) error
- func (c *Client) DeleteUser(ctx context.Context, password []byte, req DeleteUserReq) error
- func (c *Client) DisableAddress(ctx context.Context, addressID string) error
- func (c *Client) EnableAddress(ctx context.Context, addressID string) error
- func (c *Client) GetAddress(ctx context.Context, addressID string) (Address, error)
- func (c *Client) GetAddresses(ctx context.Context) ([]Address, error)
- func (c *Client) GetAllCalendarEvents(ctx context.Context, calendarID string, filter url.Values) ([]CalendarEvent, error)
- func (c *Client) GetAllContactEmails(ctx context.Context, email string) ([]ContactEmail, error)
- func (c *Client) GetAllContacts(ctx context.Context) ([]Contact, error)
- func (c *Client) GetAttachment(ctx context.Context, attachmentID string) ([]byte, error)
- func (c *Client) GetAttachmentInto(ctx context.Context, attachmentID string, reader io.ReaderFrom) error
- func (c *Client) GetBlock(ctx context.Context, url string) (io.ReadCloser, error)
- func (c *Client) GetCalendar(ctx context.Context, calendarID string) (Calendar, error)
- func (c *Client) GetCalendarEvent(ctx context.Context, calendarID, eventID string) (CalendarEvent, error)
- func (c *Client) GetCalendarEvents(ctx context.Context, calendarID string, page, pageSize int, filter url.Values) ([]CalendarEvent, error)
- func (c *Client) GetCalendarKeys(ctx context.Context, calendarID string) (CalendarKeys, error)
- func (c *Client) GetCalendarMembers(ctx context.Context, calendarID string) ([]CalendarMember, error)
- func (c *Client) GetCalendarPassphrase(ctx context.Context, calendarID string) (CalendarPassphrase, error)
- func (c *Client) GetCalendars(ctx context.Context) ([]Calendar, error)
- func (c *Client) GetContact(ctx context.Context, contactID string) (Contact, error)
- func (c *Client) GetContactEmails(ctx context.Context, email string, page, pageSize int) ([]ContactEmail, error)
- func (c *Client) GetContacts(ctx context.Context, page, pageSize int) ([]Contact, error)
- func (c *Client) GetEvent(ctx context.Context, eventID string) (Event, error)
- func (c *Client) GetFullMessage(ctx context.Context, messageID string, scheduler Scheduler, ...) (FullMessage, error)
- func (c *Client) GetLabel(ctx context.Context, labelID string, labelTypes ...LabelType) (Label, error)
- func (c *Client) GetLabels(ctx context.Context, labelTypes ...LabelType) ([]Label, error)
- func (c *Client) GetLatestEventID(ctx context.Context) (string, error)
- func (c *Client) GetLink(ctx context.Context, shareID, linkID string) (Link, error)
- func (c *Client) GetMailSettings(ctx context.Context) (MailSettings, error)
- func (c *Client) GetMessage(ctx context.Context, messageID string) (Message, error)
- func (c *Client) GetMessageIDs(ctx context.Context, afterID string) ([]string, error)
- func (c *Client) GetMessageMetadata(ctx context.Context, filter MessageFilter) ([]MessageMetadata, error)
- func (c *Client) GetMessageMetadataPage(ctx context.Context, page, pageSize int, filter MessageFilter) ([]MessageMetadata, error)
- func (c *Client) GetPublicKeys(ctx context.Context, address string) (PublicKeys, RecipientType, error)
- func (c *Client) GetRevision(ctx context.Context, shareID, linkID, revisionID string) (Revision, error)
- func (c *Client) GetSalts(ctx context.Context) (Salts, error)
- func (c *Client) GetShare(ctx context.Context, shareID string) (Share, error)
- func (c *Client) GetUser(ctx context.Context) (User, error)
- func (c *Client) ImportMessages(ctx context.Context, addrKR *crypto.KeyRing, workers, buffer int, ...) (stream.Stream[ImportRes], error)
- func (c *Client) LabelMessages(ctx context.Context, messageIDs []string, labelID string) error
- func (c *Client) ListChildren(ctx context.Context, shareID, linkID string) ([]Link, error)
- func (c *Client) ListRevisions(ctx context.Context, shareID, linkID string) ([]Revision, error)
- func (c *Client) ListShares(ctx context.Context, all bool) ([]Share, error)
- func (c *Client) ListVolumes(ctx context.Context) ([]Volume, error)
- func (c *Client) MakeAddressKeyPrimary(ctx context.Context, keyID string, keyList KeyList) error
- func (c *Client) MarkMessagesRead(ctx context.Context, messageIDs ...string) error
- func (c *Client) MarkMessagesUnread(ctx context.Context, messageIDs ...string) error
- func (c *Client) NewEventStream(ctx context.Context, period, jitter time.Duration, lastEventID string) <-chan Event
- func (c *Client) OrderAddresses(ctx context.Context, req OrderAddressesReq) error
- func (c *Client) SendDraft(ctx context.Context, draftID string, req SendDraftReq) (Message, error)
- func (c *Client) SetAttachPublicKey(ctx context.Context, req SetAttachPublicKeyReq) (MailSettings, error)
- func (c *Client) SetDefaultPGPScheme(ctx context.Context, req SetDefaultPGPSchemeReq) (MailSettings, error)
- func (c *Client) SetDisplayName(ctx context.Context, req SetDisplayNameReq) (MailSettings, error)
- func (c *Client) SetDraftMIMEType(ctx context.Context, req SetDraftMIMETypeReq) (MailSettings, error)
- func (c *Client) SetSignExternalMessages(ctx context.Context, req SetSignExternalMessagesReq) (MailSettings, error)
- func (c *Client) SetSignature(ctx context.Context, req SetSignatureReq) (MailSettings, error)
- func (c *Client) UndoActions(ctx context.Context, tokens ...UndoToken) ([]UndoRes, error)
- func (c *Client) UnlabelMessages(ctx context.Context, messageIDs []string, labelID string) error
- func (c *Client) UpdateContact(ctx context.Context, contactID string, req UpdateContactReq) (Contact, error)
- func (c *Client) UpdateDraft(ctx context.Context, draftID string, addrKR *crypto.KeyRing, ...) (Message, error)
- func (c *Client) UpdateLabel(ctx context.Context, labelID string, req UpdateLabelReq) (Label, error)
- func (c *Client) UploadAttachment(ctx context.Context, addrKR *crypto.KeyRing, req CreateAttachmentReq) (Attachment, error)
- func (c *Client) VisitLink(ctx context.Context, shareID string, link Link, kr *crypto.KeyRing, ...) error
- type ClientType
- type Code
- type Contact
- type ContactCards
- type ContactEmail
- type ContactMetadata
- type ContactSettings
- type CreateAddressKeyReq
- type CreateAttachmentReq
- type CreateContactsReq
- type CreateContactsRes
- type CreateDraftAction
- type CreateDraftReq
- type CreateLabelReq
- type CreateUserReq
- type DefaultAttachmentAllocator
- type DeleteContactsReq
- type DeleteUserReq
- type Disposition
- type DraftTemplate
- type EncryptionScheme
- type Event
- type EventAction
- type EventItem
- type FIDO2Info
- type FIDO2Req
- type FileProperties
- type FileRevisionState
- type FolderProperties
- type FullMessage
- type Future
- type Group
- type Handler
- type Headers
- type ImportMetadata
- type ImportReq
- type ImportRes
- type Key
- type KeyList
- type KeyListEntry
- type KeyState
- type Keys
- type Label
- type LabelEvent
- type LabelMessageRes
- type LabelMessagesReq
- type LabelMessagesRes
- type LabelType
- type Link
- type LinkEvent
- type LinkEventType
- type LinkState
- type LinkType
- type LinkWalkFunc
- type Listener
- type MailSettings
- type MakeAddressKeyPrimaryReq
- type Manager
- func (m *Manager) AddErrorHandler(code Code, handler Handler)
- func (m *Manager) AddPostRequestHook(hook resty.ResponseMiddleware)
- func (m *Manager) AddPreRequestHook(hook resty.RequestMiddleware)
- func (m *Manager) AddStatusObserver(observer StatusObserver)
- func (m *Manager) AuthInfo(ctx context.Context, req AuthInfoReq) (AuthInfo, error)
- func (m *Manager) AuthModulus(ctx context.Context) (AuthModulus, error)
- func (m *Manager) Close()
- func (m *Manager) CreateUser(ctx context.Context, req CreateUserReq) (User, error)
- func (m *Manager) DownloadAndVerify(ctx context.Context, kr *crypto.KeyRing, url, sig string) ([]byte, error)
- func (m *Manager) GetCaptcha(ctx context.Context, token string) ([]byte, error)
- func (m *Manager) GetDomains(ctx context.Context) ([]string, error)
- func (m *Manager) GetUsernameAvailable(ctx context.Context, username string) error
- func (m *Manager) NewClient(uid, acc, ref string) *Client
- func (m *Manager) NewClientWithLogin(ctx context.Context, username string, password []byte) (*Client, Auth, error)
- func (m *Manager) NewClientWithRefresh(ctx context.Context, uid, ref string) (*Client, Auth, error)
- func (m *Manager) Ping(ctx context.Context) error
- func (m *Manager) Quark(ctx context.Context, command string, args ...string) error
- func (m *Manager) QuarkRes(ctx context.Context, command string, args ...string) ([]byte, error)
- func (m *Manager) ReportBug(ctx context.Context, req ReportBugReq, atts ...ReportBugAttachment) error
- func (m *Manager) SendVerificationCode(ctx context.Context, req SendVerificationCodeReq) error
- type MemberPassphrase
- type Message
- type MessageActionReq
- type MessageEvent
- type MessageFilter
- type MessageFlag
- func (f MessageFlag) Add(flag MessageFlag) MessageFlag
- func (f MessageFlag) Has(flag MessageFlag) bool
- func (f MessageFlag) HasAll(flags ...MessageFlag) bool
- func (f MessageFlag) HasAny(flags ...MessageFlag) bool
- func (f MessageFlag) Matches(flag MessageFlag) bool
- func (f MessageFlag) Remove(flag MessageFlag) MessageFlag
- func (f MessageFlag) Toggle(flag MessageFlag) MessageFlag
- type MessageMetadata
- type MessagePackage
- type MessageRecipient
- type NetCtl
- func (c *NetCtl) Disable()
- func (c *NetCtl) Enable()
- func (c *NetCtl) NewRoundTripper(tlsConfig *tls.Config) http.RoundTripper
- func (c *NetCtl) OnDial(f func(net.Conn))
- func (c *NetCtl) OnRead(fn func([]byte))
- func (c *NetCtl) OnWrite(fn func([]byte))
- func (c *NetCtl) SetCanDial(canDial bool)
- func (c *NetCtl) SetCanRead(canRead bool)
- func (c *NetCtl) SetCanWrite(canWrite bool)
- func (c *NetCtl) SetDialLimit(limit uint64)
- func (c *NetCtl) SetReadLimit(limit uint64)
- func (c *NetCtl) SetReadSpeed(speed int)
- func (c *NetCtl) SetWriteLimit(limit uint64)
- func (c *NetCtl) SetWriteSpeed(speed int)
- type NetError
- type Option
- func WithAppVersion(appVersion string) Option
- func WithCookieJar(jar http.CookieJar) Option
- func WithDebug(debug bool) Option
- func WithHostURL(hostURL string) Option
- func WithLogger(logger resty.Logger) Option
- func WithRetryCount(retryCount int) Option
- func WithSkipVerifyProofs() Option
- func WithTransport(transport http.RoundTripper) Option
- type OrderAddressesReq
- type ParallelScheduler
- type PasswordMode
- type Permissions
- type Pool
- func (pool *Pool[In, Out]) Done()
- func (pool *Pool[In, Out]) Process(ctx context.Context, reqs []In, fn func(int, In, Out, error) error) error
- func (pool *Pool[In, Out]) ProcessAll(ctx context.Context, reqs []In) ([]Out, error)
- func (pool *Pool[In, Out]) ProcessOne(ctx context.Context, req In) (Out, error)
- type PublicKey
- type PublicKeys
- type RecipientType
- type RefreshFlag
- type RegisteredKey
- type ReportBugAttachment
- type ReportBugReq
- type Revision
- type Salt
- type Salts
- type Scheduler
- type SendDraftReq
- type SendPreferences
- type SendVerificationCodeReq
- type SequentialScheduler
- type SessionKey
- type SetAttachPublicKeyReq
- type SetDefaultPGPSchemeReq
- type SetDisplayNameReq
- type SetDraftMIMETypeReq
- type SetSignExternalMessagesReq
- type SetSignatureReq
- type Share
- type ShareFlags
- type ShareState
- type ShareType
- type SignExternalMessages
- type Signature
- type SignatureType
- type Status
- type StatusObserver
- type Ticker
- type TokenDestination
- type TokenType
- type TwoFAInfo
- type TwoFAStatus
- type UndoRes
- type UndoToken
- type UpdateContactReq
- type UpdateDraftReq
- type UpdateLabelReq
- type User
- type UserType
- type Volume
- type VolumeState
Examples ¶
Constants ¶
const ( FieldPMScheme = "X-PM-SCHEME" FieldPMSign = "X-PM-SIGN" FieldPMEncrypt = "X-PM-ENCRYPT" FieldPMMIMEType = "X-PM-MIMETYPE" )
const ( InboxLabel = "0" AllDraftsLabel = "1" AllSentLabel = "2" TrashLabel = "3" SpamLabel = "4" AllMailLabel = "5" ArchiveLabel = "6" SentLabel = "7" DraftsLabel = "8" OutboxLabel = "9" StarredLabel = "10" AllScheduledLabel = "12" )
const ( // DefaultHostURL is the default host of the API. DefaultHostURL = "https://mail.proton.me/api" // DefaultAppVersion is the default app version used to communicate with the API. // This must be changed (using the WithAppVersion option) for production use. DefaultAppVersion = "go-proton-api" )
Variables ¶
CharsetReader returns a charset decoder for the given charset. If set, it will be used to decode non-utf8 encoded messages.
var ErrBadHeader = errors.New("bad header")
var ErrInvalidProof = errors.New("unexpected server proof")
var ErrJobCancelled = errors.New("job cancelled by surrounding context")
ErrJobCancelled indicates the job was cancelled.
var ErrNoSuchLabel = errors.New("no such label")
var ErrUndoTokenExpired = errors.New("undo token expired")
Functions ¶
func BuildRFC822 ¶
func ClientIDFromContext ¶
ClientIDFromContext returns true if this context was marked as originating from a client.
func DecodeKeyPacket ¶
func EncryptRFC822 ¶
EncryptRFC822 encrypts the given message literal as a PGP attachment.
func InsecureTransport ¶
InsecureTransport returns an http.Transport with InsecureSkipVerify set to true.
Types ¶
type APIError ¶ added in v0.3.0
type APIError struct { // Status is the HTTP status code of the response that caused the error. Status int // Code is the error code returned by the API. Code Code // Message is the error message returned by the API. Message string `json:"Error"` }
APIError represents an error returned by the API.
type AddressEvent ¶
type AddressStatus ¶
type AddressStatus int
const ( AddressStatusDisabled AddressStatus = iota AddressStatusEnabled AddressStatusDeleting )
type Attachment ¶
type AttachmentAllocator ¶ added in v0.4.0
type AttachmentAllocator interface { // NewBuffer should return a new byte buffer for use. Note that this function may be called from multiple go-routines. NewBuffer() *bytes.Buffer }
AttachmentAllocator abstract the attachment download buffer creation.
type Attributes ¶
type Attributes uint32
type Auth2FAReq ¶
type AuthHandler ¶
type AuthHandler func(Auth)
AuthHandler is given any new auths that are returned from the API due to an unexpected auth refresh.
type AuthInfoReq ¶
type AuthInfoReq struct {
Username string
}
type AuthModulus ¶ added in v0.2.2
type AuthRefreshReq ¶
type AuthReq ¶
type AuthReq struct { Auth2FAReq `json:",omitempty"` Username string ClientEphemeral string ClientProof string SRPSession string }
type AuthSession ¶
type AuthVerifier ¶ added in v0.2.2
type Bool ¶
type Bool bool
Bool is a convenience type for boolean values; it converts from APIBool to Go's builtin bool type.
func (Bool) MarshalJSON ¶
func (*Bool) UnmarshalJSON ¶
type Calendar ¶
type Calendar struct { ID string Name string Description string Color string Display Bool Type CalendarType Flags CalendarFlag }
type CalendarAttendee ¶
type CalendarAttendee struct { ID string Token string Status CalendarAttendeeStatus Permissions CalendarPermissions }
type CalendarAttendeeStatus ¶
type CalendarAttendeeStatus int
TODO: What is this?
const ( CalendarAttendeeStatusPending CalendarAttendeeStatus = iota CalendarAttendeeStatusMaybe CalendarAttendeeStatusNo CalendarAttendeeStatusYes )
type CalendarEvent ¶
type CalendarEvent struct { ID string UID string CalendarID string CreateTime int64 LastEditTime int64 StartTime int64 StartTimezone string EndTime int64 EndTimezone string FullDay Bool Author string Permissions CalendarPermissions Attendees []CalendarAttendee CalendarKeyPacket string CalendarEvents []CalendarEventPart AttendeesEvents []CalendarEventPart PersonalEvents []CalendarEventPart }
type CalendarEventPart ¶
type CalendarEventPart struct { MemberID string Type CalendarEventType Data string Signature string Author string }
TODO: Only personal events have MemberID; should we have a different type for that?
type CalendarEventType ¶
type CalendarEventType int
const ( CalendarEventTypeClear CalendarEventType = iota CalendarEventTypeEncrypted CalendarEventTypeSigned )
type CalendarFlag ¶
type CalendarFlag int64
const ( CalendarFlagActive CalendarFlag = 1 << iota CalendarFlagUpdatePassphrase CalendarFlagResetNeeded CalendarFlagIncompleteSetup CalendarFlagLostAccess )
type CalendarKey ¶
type CalendarKey struct { ID string CalendarID string PassphraseID string PrivateKey string Flags CalendarKeyFlag }
type CalendarKeyFlag ¶
type CalendarKeyFlag int64
TODO: What is this?
const ( CalendarKeyFlagActive CalendarKeyFlag = 1 << iota CalendarKeyFlagPrimary )
type CalendarKeys ¶
type CalendarKeys []CalendarKey
type CalendarMember ¶
type CalendarPassphrase ¶
type CalendarPassphrase struct { ID string Flags CalendarPassphraseFlag MemberPassphrases []MemberPassphrase }
TODO: Support invitations.
type CalendarType ¶
type CalendarType int
const ( CalendarTypeNormal CalendarType = iota CalendarTypeSubscribed )
type Card ¶
func (*Card) DeleteGroup ¶
DeleteGroup removes all values in the group defined by the given key/value pair.
type CardGroup ¶
type CardGroup struct { Card // contains filtered or unexported fields }
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the proton client.
func (*Client) AddAuthHandler ¶
func (c *Client) AddAuthHandler(handler AuthHandler)
Example ¶
ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Create a new manager. m := proton.New() // Create a new client. c := m.NewClient("...uid...", "...acc...", "...ref...") defer c.Close() // Register an auth handler with the client. // This could be used for example to save the auth to keychain. c.AddAuthHandler(func(auth proton.Auth) { // Do something with auth. }) if _, err := c.GetUser(ctx); err != nil { panic(err) }
Output:
func (*Client) AddDeauthHandler ¶
func (*Client) AddPostRequestHook ¶
func (c *Client) AddPostRequestHook(hook resty.ResponseMiddleware)
func (*Client) AddPreRequestHook ¶
func (c *Client) AddPreRequestHook(hook resty.RequestMiddleware)
func (*Client) AuthSessions ¶
func (c *Client) AuthSessions(ctx context.Context) ([]AuthSession, error)
func (*Client) CountCalendarEvents ¶
func (*Client) CountContactEmails ¶
func (*Client) CreateAddressKey ¶
func (*Client) CreateContacts ¶
func (c *Client) CreateContacts(ctx context.Context, req CreateContactsReq) ([]CreateContactsRes, error)
func (*Client) CreateDraft ¶
func (*Client) CreateLabel ¶
func (*Client) CreateLegacyAddressKey ¶
func (*Client) DeleteAddress ¶ added in v0.2.2
func (*Client) DeleteAddressKey ¶
func (*Client) DeleteContacts ¶
func (c *Client) DeleteContacts(ctx context.Context, req DeleteContactsReq) error
func (*Client) DeleteLabel ¶
func (*Client) DeleteMessage ¶
func (*Client) DeleteUser ¶ added in v0.2.2
func (*Client) DisableAddress ¶ added in v0.2.2
func (*Client) EnableAddress ¶ added in v0.2.2
func (*Client) GetAddress ¶
func (*Client) GetAllCalendarEvents ¶
func (*Client) GetAllContactEmails ¶
func (*Client) GetAllContacts ¶
func (*Client) GetAttachment ¶
func (*Client) GetAttachmentInto ¶ added in v0.4.0
func (*Client) GetCalendar ¶
func (*Client) GetCalendarEvent ¶
func (*Client) GetCalendarEvents ¶
func (c *Client) GetCalendarEvents(ctx context.Context, calendarID string, page, pageSize int, filter url.Values) ([]CalendarEvent, error)
TODO: For now, the query params are partially constant -- should they be configurable?
func (*Client) GetCalendarKeys ¶
func (*Client) GetCalendarMembers ¶
func (*Client) GetCalendarPassphrase ¶
func (*Client) GetCalendars ¶
func (*Client) GetContact ¶
func (*Client) GetContactEmails ¶
func (*Client) GetContacts ¶
func (*Client) GetFullMessage ¶
func (c *Client) GetFullMessage(ctx context.Context, messageID string, scheduler Scheduler, storageProvider AttachmentAllocator) (FullMessage, error)
func (*Client) GetLatestEventID ¶
func (*Client) GetMailSettings ¶
func (c *Client) GetMailSettings(ctx context.Context) (MailSettings, error)
func (*Client) GetMessage ¶
func (*Client) GetMessageIDs ¶
func (*Client) GetMessageMetadata ¶
func (c *Client) GetMessageMetadata(ctx context.Context, filter MessageFilter) ([]MessageMetadata, error)
func (*Client) GetMessageMetadataPage ¶ added in v0.4.0
func (c *Client) GetMessageMetadataPage(ctx context.Context, page, pageSize int, filter MessageFilter) ([]MessageMetadata, error)
func (*Client) GetPublicKeys ¶
func (c *Client) GetPublicKeys(ctx context.Context, address string) (PublicKeys, RecipientType, error)
func (*Client) GetRevision ¶
func (*Client) ImportMessages ¶
func (*Client) LabelMessages ¶
func (*Client) ListChildren ¶
func (*Client) ListRevisions ¶
func (*Client) ListShares ¶
func (*Client) MakeAddressKeyPrimary ¶
func (*Client) MarkMessagesRead ¶
func (*Client) MarkMessagesUnread ¶
func (*Client) NewEventStream ¶
func (c *Client) NewEventStream(ctx context.Context, period, jitter time.Duration, lastEventID string) <-chan Event
NewEventStreamer returns a new event stream. It polls the API for new events at random intervals between `period` and `period+jitter`.
Example ¶
m := proton.New() ctx, cancel := context.WithCancel(context.Background()) defer cancel() c, _, err := m.NewClientWithLogin(ctx, "...user...", []byte("...pass...")) if err != nil { panic(err) } defer c.Close() // Get the latest event ID. fromEventID, err := c.GetLatestEventID(context.Background()) if err != nil { panic(err) } // Create a new event streamer. for event := range c.NewEventStream(ctx, 20*time.Second, 20*time.Second, fromEventID) { fmt.Println(event.EventID) }
Output:
func (*Client) OrderAddresses ¶
func (c *Client) OrderAddresses(ctx context.Context, req OrderAddressesReq) error
func (*Client) SetAttachPublicKey ¶
func (c *Client) SetAttachPublicKey(ctx context.Context, req SetAttachPublicKeyReq) (MailSettings, error)
func (*Client) SetDefaultPGPScheme ¶
func (c *Client) SetDefaultPGPScheme(ctx context.Context, req SetDefaultPGPSchemeReq) (MailSettings, error)
func (*Client) SetDisplayName ¶
func (c *Client) SetDisplayName(ctx context.Context, req SetDisplayNameReq) (MailSettings, error)
func (*Client) SetDraftMIMEType ¶
func (c *Client) SetDraftMIMEType(ctx context.Context, req SetDraftMIMETypeReq) (MailSettings, error)
func (*Client) SetSignExternalMessages ¶
func (c *Client) SetSignExternalMessages(ctx context.Context, req SetSignExternalMessagesReq) (MailSettings, error)
func (*Client) SetSignature ¶
func (c *Client) SetSignature(ctx context.Context, req SetSignatureReq) (MailSettings, error)
func (*Client) UndoActions ¶
func (*Client) UnlabelMessages ¶
func (*Client) UpdateContact ¶
func (*Client) UpdateDraft ¶ added in v0.1.5
func (*Client) UpdateLabel ¶
func (*Client) UploadAttachment ¶
func (c *Client) UploadAttachment(ctx context.Context, addrKR *crypto.KeyRing, req CreateAttachmentReq) (Attachment, error)
type ClientType ¶
type ClientType int
const ( ClientTypeEmail ClientType = iota + 1 ClientTypeVPN ClientTypeCalendar ClientTypeDrive )
type Code ¶
type Code int
const ( SuccessCode Code = 1000 MultiCode Code = 1001 InvalidValue Code = 2001 AppVersionMissingCode Code = 5001 AppVersionBadCode Code = 5003 UsernameInvalid Code = 6003 // Deprecated, but still used. PasswordWrong Code = 8002 HumanVerificationRequired Code = 9001 PaidPlanRequired Code = 10004 AuthRefreshTokenInvalid Code = 10013 )
type ContactCards ¶
type ContactCards struct {
Cards Cards
}
type ContactEmail ¶
type ContactMetadata ¶
type ContactSettings ¶
type CreateAddressKeyReq ¶
type CreateAttachmentReq ¶
type CreateContactsReq ¶
type CreateContactsReq struct { Contacts []ContactCards Overwrite int Labels int }
type CreateContactsRes ¶
type CreateDraftAction ¶
type CreateDraftAction int
const ( ReplyAction CreateDraftAction = iota ReplyAllAction ForwardAction AutoResponseAction ReadReceiptAction )
type CreateDraftReq ¶
type CreateDraftReq struct { Message DraftTemplate AttachmentKeyPackets []string ParentID string `json:",omitempty"` Action CreateDraftAction }
type CreateLabelReq ¶
type CreateUserReq ¶
type CreateUserReq struct { Type UserType Username string Domain string Auth AuthVerifier }
type DefaultAttachmentAllocator ¶ added in v0.4.0
type DefaultAttachmentAllocator struct{}
func NewDefaultAttachmentAllocator ¶ added in v0.4.0
func NewDefaultAttachmentAllocator() *DefaultAttachmentAllocator
func (DefaultAttachmentAllocator) NewBuffer ¶ added in v0.4.0
func (DefaultAttachmentAllocator) NewBuffer() *bytes.Buffer
type DeleteContactsReq ¶
type DeleteContactsReq struct {
IDs []string
}
type DeleteUserReq ¶ added in v0.2.2
type Disposition ¶
type Disposition string
const ( InlineDisposition Disposition = "inline" AttachmentDisposition Disposition = "attachment" )
type DraftTemplate ¶
type EncryptionScheme ¶
type EncryptionScheme int
const ( InternalScheme EncryptionScheme = 1 << iota EncryptedOutsideScheme ClearScheme PGPInlineScheme PGPMIMEScheme ClearMIMEScheme )
type Event ¶
type Event struct { EventID string Refresh RefreshFlag User *User MailSettings *MailSettings Messages []MessageEvent Labels []LabelEvent Addresses []AddressEvent UsedSpace *int }
type EventAction ¶
type EventAction int
const ( EventDelete EventAction = iota EventCreate EventUpdate EventUpdateFlags )
type EventItem ¶
type EventItem struct { ID string Action EventAction }
type FIDO2Info ¶ added in v0.2.1
type FIDO2Info struct { AuthenticationOptions any RegisteredKeys []RegisteredKey }
type FileProperties ¶
type FileRevisionState ¶
type FileRevisionState int
const ( DraftRevisionState FileRevisionState = iota ActiveRevisionState ObsoleteRevisionState )
type FolderProperties ¶
type FolderProperties struct{}
type FullMessage ¶
type Handler ¶
type Handler func()
Handler is a generic function that can be registered for a certain event (e.g. deauth, API code).
type Headers ¶
func (*Headers) UnmarshalJSON ¶
type ImportMetadata ¶
type ImportMetadata struct { AddressID string LabelIDs []string Unread Bool Flags MessageFlag }
type ImportReq ¶
type ImportReq struct { Metadata ImportMetadata Message []byte }
type Key ¶
type Key struct { ID string PrivateKey []byte Token string Signature string Primary Bool Active Bool Flags KeyState }
func (Key) MarshalJSON ¶
func (*Key) UnmarshalJSON ¶
type KeyList ¶
func NewKeyList ¶
func NewKeyList(signer *crypto.KeyRing, entries []KeyListEntry) (KeyList, error)
type KeyListEntry ¶
type LabelEvent ¶
type LabelMessageRes ¶
type LabelMessagesReq ¶
type LabelMessagesRes ¶
type LabelMessagesRes struct { Responses []LabelMessageRes UndoToken UndoToken }
type Link ¶
type Link struct { LinkID string // Encrypted file/folder ID ParentLinkID string // Encrypted parent folder ID (LinkID) Type LinkType Name string // Encrypted file name Hash string // HMAC of name encrypted with parent hash key State LinkState // State of the link ExpirationTime int64 Size int64 MIMEType string Attributes Attributes Permissions Permissions NodeKey string NodePassphrase string NodePassphraseSignature string SignatureAddress string CreateTime int64 ModifyTime int64 FileProperties FileProperties FolderProperties FolderProperties }
type LinkEvent ¶
type LinkEvent struct { EventID string // Encrypted ID of the Event CreateTime int64 // Time stamp of the creation time of the Event EventType LinkEventType // Type of event }
type LinkEventType ¶
type LinkEventType int
const ( DeleteLinkEvent LinkEventType = iota CreateLinkEvent UpdateContentsLinkEvent UpdateMetadataLinkEvent )
type Listener ¶ added in v0.4.0
Listener wraps a net.Listener. It can be configured to spawn connections that drop all reads or writes.
func NewListener ¶ added in v0.4.0
NewListener returns a new DropListener.
func (*Listener) Done ¶ added in v0.4.0
func (l *Listener) Done() <-chan struct{}
Done returns a channel that is closed when the listener is closed.
func (*Listener) DropAll ¶ added in v0.4.0
func (l *Listener) DropAll()
DropAll closes all connections spawned by this listener.
func (*Listener) SetCanRead ¶ added in v0.4.0
SetCanRead sets whether the connections spawned by this listener can read.
func (*Listener) SetCanWrite ¶ added in v0.4.0
SetCanWrite sets whether the connections spawned by this listener can write.
type MailSettings ¶
type MailSettings struct { DisplayName string Signature string DraftMIMEType rfc822.MIMEType AttachPublicKey Bool Sign SignExternalMessages PGPScheme EncryptionScheme }
type MakeAddressKeyPrimaryReq ¶
type MakeAddressKeyPrimaryReq struct {
SignedKeyList KeyList
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) AddErrorHandler ¶
func (*Manager) AddPostRequestHook ¶
func (m *Manager) AddPostRequestHook(hook resty.ResponseMiddleware)
func (*Manager) AddPreRequestHook ¶
func (m *Manager) AddPreRequestHook(hook resty.RequestMiddleware)
func (*Manager) AddStatusObserver ¶
func (m *Manager) AddStatusObserver(observer StatusObserver)
func (*Manager) AuthModulus ¶ added in v0.2.2
func (m *Manager) AuthModulus(ctx context.Context) (AuthModulus, error)
func (*Manager) CreateUser ¶ added in v0.2.2
func (*Manager) DownloadAndVerify ¶
func (*Manager) GetCaptcha ¶ added in v0.2.2
func (*Manager) GetDomains ¶ added in v0.2.2
func (*Manager) GetUsernameAvailable ¶ added in v0.2.2
func (*Manager) NewClient ¶
Example ¶
// Create a new manager. m := proton.New() // If auth information is already known, it can be used to create a client straight away. c := m.NewClient("...uid...", "...acc...", "...ref...") defer c.Close() // All API operations must be run within a context. ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Do something with the client. if _, err := c.GetUser(ctx); err != nil { panic(err) }
Output:
func (*Manager) NewClientWithLogin ¶
func (m *Manager) NewClientWithLogin(ctx context.Context, username string, password []byte) (*Client, Auth, error)
Example ¶
// Create a new manager. m := proton.New() // All API operations must be run within a context. ctx, cancel := context.WithCancel(context.Background()) defer cancel() // Clients are created via username/password if auth information isn't already known. c, auth, err := m.NewClientWithLogin(ctx, "...user...", []byte("...pass...")) if err != nil { panic(err) } defer c.Close() // If 2FA is necessary, an additional request is required. if auth.TwoFA.Enabled&proton.HasTOTP != 0 { if err := c.Auth2FA(ctx, proton.Auth2FAReq{TwoFactorCode: "...TOTP..."}); err != nil { panic(err) } } // Do something with the client. if _, err := c.GetUser(ctx); err != nil { panic(err) }
Output:
func (*Manager) NewClientWithRefresh ¶
Example ¶
// Create a new manager. m := proton.New() // All API operations must be run within a context. ctx, cancel := context.WithCancel(context.Background()) defer cancel() // If UID/RefreshToken is already known, it can be used to create a new client straight away. c, _, err := m.NewClientWithRefresh(ctx, "...uid...", "...ref...") if err != nil { panic(err) } defer c.Close() // Do something with the client. if _, err := c.GetUser(ctx); err != nil { panic(err) }
Output:
func (*Manager) QuarkRes ¶ added in v0.2.2
QuarkRes is the same as Quark, but returns the content extracted from the response body.
func (*Manager) ReportBug ¶
func (m *Manager) ReportBug(ctx context.Context, req ReportBugReq, atts ...ReportBugAttachment) error
func (*Manager) SendVerificationCode ¶ added in v0.2.2
func (m *Manager) SendVerificationCode(ctx context.Context, req SendVerificationCodeReq) error
type MemberPassphrase ¶
type Message ¶
type Message struct { MessageMetadata Header string ParsedHeaders Headers Body string MIMEType rfc822.MIMEType Attachments []Attachment }
func (Message) DecryptInto ¶ added in v0.4.0
type MessageActionReq ¶
type MessageActionReq struct {
IDs []string
}
type MessageEvent ¶
type MessageEvent struct { EventItem Message MessageMetadata }
type MessageFilter ¶
type MessageFlag ¶
type MessageFlag int64
const ( MessageFlagReceived MessageFlag = 1 << 0 MessageFlagSent MessageFlag = 1 << 1 MessageFlagInternal MessageFlag = 1 << 2 MessageFlagE2E MessageFlag = 1 << 3 MessageFlagAuto MessageFlag = 1 << 4 MessageFlagReplied MessageFlag = 1 << 5 MessageFlagRepliedAll MessageFlag = 1 << 6 MessageFlagForwarded MessageFlag = 1 << 7 MessageFlagAutoReplied MessageFlag = 1 << 8 MessageFlagImported MessageFlag = 1 << 9 MessageFlagOpened MessageFlag = 1 << 10 MessageFlagReceiptSent MessageFlag = 1 << 11 MessageFlagNotified MessageFlag = 1 << 12 MessageFlagTouched MessageFlag = 1 << 13 MessageFlagReceipt MessageFlag = 1 << 14 MessageFlagReceiptRequest MessageFlag = 1 << 16 MessageFlagPublicKey MessageFlag = 1 << 17 MessageFlagSign MessageFlag = 1 << 18 MessageFlagUnsubscribed MessageFlag = 1 << 19 MessageFlagScheduledSend MessageFlag = 1 << 20 MessageFlagAlias MessageFlag = 1 << 21 MessageFlagDMARCPass MessageFlag = 1 << 23 MessageFlagSPFFail MessageFlag = 1 << 24 MessageFlagDKIMFail MessageFlag = 1 << 25 MessageFlagDMARCFail MessageFlag = 1 << 26 MessageFlagHamManual MessageFlag = 1 << 27 MessageFlagSpamAuto MessageFlag = 1 << 28 MessageFlagSpamManual MessageFlag = 1 << 29 MessageFlagPhishingAuto MessageFlag = 1 << 30 MessageFlagPhishingManual MessageFlag = 1 << 31 )
func (MessageFlag) Add ¶
func (f MessageFlag) Add(flag MessageFlag) MessageFlag
func (MessageFlag) Has ¶
func (f MessageFlag) Has(flag MessageFlag) bool
func (MessageFlag) HasAll ¶
func (f MessageFlag) HasAll(flags ...MessageFlag) bool
func (MessageFlag) HasAny ¶
func (f MessageFlag) HasAny(flags ...MessageFlag) bool
func (MessageFlag) Matches ¶
func (f MessageFlag) Matches(flag MessageFlag) bool
func (MessageFlag) Remove ¶
func (f MessageFlag) Remove(flag MessageFlag) MessageFlag
func (MessageFlag) Toggle ¶
func (f MessageFlag) Toggle(flag MessageFlag) MessageFlag
type MessageMetadata ¶
type MessageMetadata struct { ID string AddressID string LabelIDs []string ExternalID string Subject string Sender *mail.Address ToList []*mail.Address CCList []*mail.Address BCCList []*mail.Address ReplyTos []*mail.Address Flags MessageFlag Time int64 Size int Unread Bool IsReplied Bool IsRepliedAll Bool IsForwarded Bool }
func (MessageMetadata) IsDraft ¶
func (meta MessageMetadata) IsDraft() bool
func (MessageMetadata) Seen ¶
func (meta MessageMetadata) Seen() bool
func (MessageMetadata) Starred ¶
func (meta MessageMetadata) Starred() bool
type MessagePackage ¶
type MessagePackage struct { Addresses map[string]*MessageRecipient MIMEType rfc822.MIMEType Type EncryptionScheme Body string BodyKey *SessionKey `json:",omitempty"` AttachmentKeys map[string]*SessionKey `json:",omitempty"` }
type MessageRecipient ¶
type MessageRecipient struct { Type EncryptionScheme Signature SignatureType BodyKeyPacket string `json:",omitempty"` AttachmentKeyPackets map[string]string `json:",omitempty"` }
type NetCtl ¶
type NetCtl struct {
// contains filtered or unexported fields
}
ctl can be used to control whether a dialer can dial, and whether the resulting connection can read or write.
func (*NetCtl) Disable ¶
func (c *NetCtl) Disable()
Disable is equivalent to disallowing dial, read and write.
func (*NetCtl) Enable ¶
func (c *NetCtl) Enable()
Enable is equivalent to allowing dial, read and write.
func (*NetCtl) NewRoundTripper ¶ added in v0.2.2
func (c *NetCtl) NewRoundTripper(tlsConfig *tls.Config) http.RoundTripper
NewDialer returns a new dialer controlled by the ctl.
func (*NetCtl) OnDial ¶
OnDial adds a callback that is called with the created connection when a dial is successful.
func (*NetCtl) OnRead ¶
OnRead adds a callback that is called with the read bytes when a read is successful.
func (*NetCtl) OnWrite ¶
OnWrite adds a callback that is called with the written bytes when a write is successful.
func (*NetCtl) SetCanDial ¶
SetCanDial sets whether the dialer can dial.
func (*NetCtl) SetCanRead ¶
SetCanRead sets whether the connection can read.
func (*NetCtl) SetCanWrite ¶
SetCanWrite sets whether the connection can write.
func (*NetCtl) SetDialLimit ¶
SetDialLimit sets the maximum number of times dialers using this controller can dial.
func (*NetCtl) SetReadLimit ¶
SetReadLimit sets the maximum number of bytes that can be read.
func (*NetCtl) SetReadSpeed ¶ added in v0.2.2
SetReadSpeed sets the maximum number of bytes that can be read per second.
func (*NetCtl) SetWriteLimit ¶
SetWriteLimit sets the maximum number of bytes that can be written.
func (*NetCtl) SetWriteSpeed ¶ added in v0.2.2
SetWriteSpeed sets the maximum number of bytes that can be written per second.
type NetError ¶ added in v0.3.0
type NetError struct { // Cause is the underlying error that caused the network error. Cause error // Message is an additional message that describes the network error. Message string }
NetError represents a network error. It is returned when the API is unreachable.
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option represents a type that can be used to configure the manager.
func WithAppVersion ¶
func WithCookieJar ¶
func WithHostURL ¶
func WithLogger ¶
func WithLogger(logger resty.Logger) Option
func WithRetryCount ¶
func WithSkipVerifyProofs ¶
func WithSkipVerifyProofs() Option
func WithTransport ¶
func WithTransport(transport http.RoundTripper) Option
type OrderAddressesReq ¶
type OrderAddressesReq struct {
AddressIDs []string
}
type ParallelScheduler ¶ added in v0.4.0
type ParallelScheduler struct {
// contains filtered or unexported fields
}
func NewParallelScheduler ¶ added in v0.4.0
func NewParallelScheduler(workers int) *ParallelScheduler
type PasswordMode ¶
type PasswordMode int
const ( OnePasswordMode PasswordMode = iota + 1 TwoPasswordMode )
type Permissions ¶
type Permissions int
const ( NoPermissions Permissions = 1 << iota ReadPermission WritePermission AdministerMembersPermission AdminPermission SuperAdminPermission )
type Pool ¶
type Pool[In comparable, Out any] struct { // contains filtered or unexported fields }
Pool is a worker pool that handles input of type In and returns results of type Out.
func NewPool ¶
func NewPool[In comparable, Out any](size int, work func(context.Context, In) (Out, error)) *Pool[In, Out]
New returns a new pool.
func (*Pool[In, Out]) Process ¶
func (pool *Pool[In, Out]) Process(ctx context.Context, reqs []In, fn func(int, In, Out, error) error) error
Process submits jobs to the pool. The callback provides access to the result, or an error if one occurred.
func (*Pool[In, Out]) ProcessAll ¶
ProcessAll submits jobs to the pool. All results are returned once available.
type PublicKeys ¶
type PublicKeys []PublicKey
func (PublicKeys) GetKeyRing ¶
func (keys PublicKeys) GetKeyRing() (*crypto.KeyRing, error)
type RecipientType ¶
type RecipientType int
const ( RecipientTypeInternal RecipientType = iota + 1 RecipientTypeExternal )
type RefreshFlag ¶
type RefreshFlag uint8
const ( RefreshMail RefreshFlag = 1 << iota // 1<<0 = 1 RefreshAll RefreshFlag = 1<<iota - 1 // 1<<8 - 1 = 255 )
type RegisteredKey ¶
type ReportBugAttachment ¶
type ReportBugReq ¶
type Revision ¶
type Revision struct { ID string // Encrypted Revision ID CreateTime int64 // Unix timestamp of the revision creation time Size int64 // Size of the file in bytes ManifestSignature string // The signature of the root hash SignatureAddress string // The address used to sign the root hash State FileRevisionState // State of revision Blocks []Block }
type Scheduler ¶ added in v0.4.0
type Scheduler interface {
Schedule(ctx context.Context, attachmentIDs []string, storageProvider AttachmentAllocator, downloader func(context.Context, string, *bytes.Buffer) error) ([]*bytes.Buffer, error)
}
Scheduler allows the user to specify how the attachment data for the message should be downloaded.
type SendDraftReq ¶
type SendDraftReq struct {
Packages []*MessagePackage
}
func (*SendDraftReq) AddMIMEPackage ¶
func (req *SendDraftReq) AddMIMEPackage( kr *crypto.KeyRing, mimeBody string, prefs map[string]SendPreferences, ) error
func (*SendDraftReq) AddTextPackage ¶
func (req *SendDraftReq) AddTextPackage( kr *crypto.KeyRing, body string, mimeType rfc822.MIMEType, prefs map[string]SendPreferences, attKeys map[string]*crypto.SessionKey, ) error
type SendPreferences ¶
type SendPreferences struct { // Encrypt indicates whether the email should be encrypted or not. // If it's encrypted, we need to know which public key to use. Encrypt bool // PubKey contains an OpenPGP key that can be used for encryption. PubKey *crypto.KeyRing // SignatureType indicates how the email should be signed. SignatureType SignatureType // EncryptionScheme indicates if we should encrypt body and attachments separately and // what MIME format to give the final encrypted email. The two standard PGP // schemes are PGP/MIME and PGP/Inline. However we use a custom scheme for // internal emails (including the so-called encrypted-to-outside emails, // which even though meant for external users, they don't really get out of // our platform). If the email is sent unencrypted, no PGP scheme is needed. EncryptionScheme EncryptionScheme // MIMEType is the MIME type to use for formatting the body of the email // (before encryption/after decryption). The standard possibilities are the // enriched HTML format, text/html, and plain text, text/plain. But it's // also possible to have a multipart/mixed format, which is typically used // for PGP/MIME encrypted emails, where attachments go into the body too. // Because of this, this option is sometimes called MIME format. MIMEType rfc822.MIMEType }
type SendVerificationCodeReq ¶
type SendVerificationCodeReq struct { Username string Type TokenType Destination TokenDestination }
type SequentialScheduler ¶ added in v0.4.0
type SequentialScheduler struct{}
SequentialScheduler downloads the attachments one by one.
func NewSequentialScheduler ¶ added in v0.4.0
func NewSequentialScheduler() *SequentialScheduler
type SessionKey ¶
type SetAttachPublicKeyReq ¶
type SetAttachPublicKeyReq struct {
AttachPublicKey Bool
}
type SetDefaultPGPSchemeReq ¶
type SetDefaultPGPSchemeReq struct {
PGPScheme EncryptionScheme
}
type SetDisplayNameReq ¶
type SetDisplayNameReq struct {
DisplayName string
}
type SetDraftMIMETypeReq ¶
type SetSignExternalMessagesReq ¶
type SetSignExternalMessagesReq struct {
Sign SignExternalMessages
}
type SetSignatureReq ¶
type SetSignatureReq struct {
Signature string
}
type ShareState ¶
type ShareState int
type SignExternalMessages ¶
type SignExternalMessages int
const ( SignExternalMessagesDisabled SignExternalMessages = iota SignExternalMessagesEnabled )
type Signature ¶
type Signature struct { Hash string Data *crypto.PGPSignature }
type SignatureType ¶
type SignatureType int
const ( NoSignature SignatureType = iota DetachedSignature AttachedSignature )
type StatusObserver ¶
type StatusObserver func(Status)
type Ticker ¶
type TokenDestination ¶
type TwoFAInfo ¶
type TwoFAInfo struct { Enabled TwoFAStatus FIDO2 FIDO2Info }
type UpdateContactReq ¶
type UpdateContactReq struct {
Cards Cards
}
type UpdateDraftReq ¶ added in v0.1.5
type UpdateDraftReq struct { Message DraftTemplate AttachmentKeyPackets []string }
type UpdateLabelReq ¶
type VolumeState ¶
type VolumeState int
Source Files ¶
- address.go
- address_types.go
- attachment.go
- attachment_interfaces.go
- attachment_types.go
- auth.go
- block.go
- boolean.go
- calendar.go
- calendar_event.go
- calendar_event_types.go
- calendar_types.go
- client.go
- contact.go
- contact_card.go
- contact_types.go
- contexts.go
- drive_types.go
- event.go
- event_types.go
- future.go
- header_types.go
- internal.go
- job.go
- keyring.go
- keys.go
- keys_types.go
- label.go
- label_types.go
- link.go
- link_types.go
- mail_settings.go
- mail_settings_types.go
- manager.go
- manager_auth.go
- manager_auth_types.go
- manager_builder.go
- manager_domains.go
- manager_download.go
- manager_ping.go
- manager_report.go
- manager_report_types.go
- manager_status.go
- manager_user.go
- manager_user_types.go
- message.go
- message_build.go
- message_draft_types.go
- message_encrypt.go
- message_import.go
- message_import_types.go
- message_send.go
- message_send_types.go
- message_types.go
- netctl.go
- option.go
- package.go
- paging.go
- pool.go
- response.go
- salt.go
- salt_types.go
- share.go
- ticker.go
- undo.go
- undo_types.go
- unlock.go
- user.go
- user_types.go
- volume.go