Documentation ¶
Index ¶
- Constants
- type Controller
- func (ctl *Controller) AddUser(user *pmapi.User, addresses *pmapi.AddressList, password string, ...) error
- func (ctl *Controller) AddUserLabel(username string, label *pmapi.Label) error
- func (ctl *Controller) AddUserMessage(username string, message *pmapi.Message) (string, error)
- func (ctl *Controller) GetCalls(method, path string) [][]byte
- func (ctl *Controller) GetLabelIDs(username string, labelNames []string) ([]string, error)
- func (ctl *Controller) GetMessages(username, labelID string) ([]*pmapi.Message, error)
- func (ctl *Controller) PrintCalls()
- func (ctl *Controller) ReorderAddresses(user *pmapi.User, addressIDs []string) error
- func (ctl *Controller) TurnInternetConnectionOff()
- func (ctl *Controller) TurnInternetConnectionOn()
- func (ctl *Controller) WasCalled(method, path string, expectedRequest []byte) bool
- type FakePMAPI
- func (api *FakePMAPI) Addresses() pmapi.AddressList
- func (api *FakePMAPI) Auth(username, password string, authInfo *pmapi.AuthInfo) (*pmapi.Auth, error)
- func (api *FakePMAPI) Auth2FA(twoFactorCode string, auth *pmapi.Auth) error
- func (api *FakePMAPI) AuthInfo(username string) (*pmapi.AuthInfo, error)
- func (api *FakePMAPI) AuthRefresh(token string) (*pmapi.Auth, error)
- func (api *FakePMAPI) AuthSalt() (string, error)
- func (api *FakePMAPI) ClearData()
- func (api *FakePMAPI) CloseConnections()
- func (api *FakePMAPI) CountMessages(addressID string) ([]*pmapi.MessagesCount, error)
- func (api *FakePMAPI) CreateAttachment(attachment *pmapi.Attachment, data io.Reader, signature io.Reader) (*pmapi.Attachment, error)
- func (api *FakePMAPI) CreateDraft(message *pmapi.Message, parentID string, action int) (*pmapi.Message, error)
- func (api *FakePMAPI) CreateLabel(label *pmapi.Label) (*pmapi.Label, error)
- func (api *FakePMAPI) CurrentUser() (*pmapi.User, error)
- func (api *FakePMAPI) DecryptAndVerifyCards(cards []pmapi.Card) ([]pmapi.Card, error)
- func (api *FakePMAPI) DeleteAttachment(attID string) error
- func (api *FakePMAPI) DeleteAuth() error
- func (api *FakePMAPI) DeleteLabel(labelID string) error
- func (api *FakePMAPI) DeleteMessages(apiIDs []string) error
- func (api *FakePMAPI) EmptyFolder(labelID string, addressID string) error
- func (api *FakePMAPI) GetAddresses() (pmapi.AddressList, error)
- func (api *FakePMAPI) GetAttachment(attachmentID string) (io.ReadCloser, error)
- func (api *FakePMAPI) GetContactByID(contactID string) (pmapi.Contact, error)
- func (api *FakePMAPI) GetContactEmailByEmail(email string, page int, pageSize int) ([]pmapi.ContactEmail, error)
- func (api *FakePMAPI) GetEvent(eventID string) (*pmapi.Event, error)
- func (api *FakePMAPI) GetMailSettings() (pmapi.MailSettings, error)
- func (api *FakePMAPI) GetMessage(apiID string) (*pmapi.Message, error)
- func (api *FakePMAPI) GetPublicKeysForEmail(email string) (keys []pmapi.PublicKey, internal bool, err error)
- func (api *FakePMAPI) Import(importMessageRequests []*pmapi.ImportMsgReq) ([]*pmapi.ImportMsgRes, error)
- func (api *FakePMAPI) IsConnected() bool
- func (api *FakePMAPI) IsUnlocked() bool
- func (api *FakePMAPI) KeyRingForAddressID(addrID string) (*crypto.KeyRing, error)
- func (api *FakePMAPI) LabelMessages(apiIDs []string, labelID string) error
- func (api *FakePMAPI) ListLabels() ([]*pmapi.Label, error)
- func (api *FakePMAPI) ListMessages(filter *pmapi.MessagesFilter) ([]*pmapi.Message, int, error)
- func (api *FakePMAPI) Logout()
- func (api *FakePMAPI) MarkMessagesRead(apiIDs []string) error
- func (api *FakePMAPI) MarkMessagesUnread(apiIDs []string) error
- func (api *FakePMAPI) ReloadKeys(passphrase []byte) (err error)
- func (api *FakePMAPI) ReorderAddresses(addressIDs []string) error
- func (api *FakePMAPI) Report(report pmapi.ReportReq) error
- func (api *FakePMAPI) ReportSentryCrash(err error) error
- func (api *FakePMAPI) SendMessage(messageID string, sendMessageRequest *pmapi.SendMessageReq) (sent, parent *pmapi.Message, err error)
- func (api *FakePMAPI) SendSimpleMetric(category, action, label string) error
- func (api *FakePMAPI) SetAuths(auths chan<- *pmapi.Auth)
- func (api *FakePMAPI) UnlabelMessages(apiIDs []string, labelID string) error
- func (api *FakePMAPI) Unlock(passphrase []byte) (err error)
- func (api *FakePMAPI) UpdateLabel(label *pmapi.Label) (*pmapi.Label, error)
- func (api *FakePMAPI) UpdateUser() (*pmapi.User, error)
Constants ¶
View Source
const ( GET method = "GET" POST method = "POST" PUT method = "PUT" DELETE method = "DELETE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(cm *pmapi.ClientManager) *Controller
func (*Controller) AddUser ¶
func (ctl *Controller) AddUser(user *pmapi.User, addresses *pmapi.AddressList, password string, twoFAEnabled bool) error
func (*Controller) AddUserLabel ¶
func (ctl *Controller) AddUserLabel(username string, label *pmapi.Label) error
func (*Controller) AddUserMessage ¶
func (*Controller) GetCalls ¶
func (ctl *Controller) GetCalls(method, path string) [][]byte
func (*Controller) GetLabelIDs ¶
func (ctl *Controller) GetLabelIDs(username string, labelNames []string) ([]string, error)
func (*Controller) GetMessages ¶
func (ctl *Controller) GetMessages(username, labelID string) ([]*pmapi.Message, error)
func (*Controller) PrintCalls ¶
func (ctl *Controller) PrintCalls()
func (*Controller) ReorderAddresses ¶
func (ctl *Controller) ReorderAddresses(user *pmapi.User, addressIDs []string) error
func (*Controller) TurnInternetConnectionOff ¶
func (ctl *Controller) TurnInternetConnectionOff()
func (*Controller) TurnInternetConnectionOn ¶
func (ctl *Controller) TurnInternetConnectionOn()
type FakePMAPI ¶
type FakePMAPI struct {
// contains filtered or unexported fields
}
func New ¶
func New(controller *Controller, userID string) *FakePMAPI
func (*FakePMAPI) Addresses ¶
func (api *FakePMAPI) Addresses() pmapi.AddressList
func (*FakePMAPI) AuthRefresh ¶
func (*FakePMAPI) CloseConnections ¶
func (api *FakePMAPI) CloseConnections()
func (*FakePMAPI) CountMessages ¶
func (api *FakePMAPI) CountMessages(addressID string) ([]*pmapi.MessagesCount, error)
func (*FakePMAPI) CreateAttachment ¶
func (api *FakePMAPI) CreateAttachment(attachment *pmapi.Attachment, data io.Reader, signature io.Reader) (*pmapi.Attachment, error)
func (*FakePMAPI) CreateDraft ¶
func (*FakePMAPI) CreateLabel ¶
func (*FakePMAPI) DecryptAndVerifyCards ¶
func (*FakePMAPI) DeleteAttachment ¶
func (*FakePMAPI) DeleteAuth ¶
func (*FakePMAPI) DeleteLabel ¶
func (*FakePMAPI) DeleteMessages ¶
func (*FakePMAPI) EmptyFolder ¶
func (*FakePMAPI) GetAddresses ¶
func (api *FakePMAPI) GetAddresses() (pmapi.AddressList, error)
func (*FakePMAPI) GetAttachment ¶
func (api *FakePMAPI) GetAttachment(attachmentID string) (io.ReadCloser, error)
func (*FakePMAPI) GetContactByID ¶
func (*FakePMAPI) GetContactEmailByEmail ¶
func (*FakePMAPI) GetMailSettings ¶
func (api *FakePMAPI) GetMailSettings() (pmapi.MailSettings, error)
func (*FakePMAPI) GetMessage ¶
func (*FakePMAPI) GetPublicKeysForEmail ¶
func (*FakePMAPI) Import ¶
func (api *FakePMAPI) Import(importMessageRequests []*pmapi.ImportMsgReq) ([]*pmapi.ImportMsgRes, error)
func (*FakePMAPI) IsConnected ¶
func (*FakePMAPI) IsUnlocked ¶
func (*FakePMAPI) KeyRingForAddressID ¶
func (*FakePMAPI) LabelMessages ¶
func (*FakePMAPI) ListMessages ¶
ListMessages does not implement following filters:
- Sort (it sorts by ID only), but Desc works
- Keyword
- To
- Subject
- ID
- Attachments
- AutoWildcard
func (*FakePMAPI) MarkMessagesRead ¶
func (*FakePMAPI) MarkMessagesUnread ¶
func (*FakePMAPI) ReloadKeys ¶
func (*FakePMAPI) ReorderAddresses ¶
func (*FakePMAPI) ReportSentryCrash ¶
func (*FakePMAPI) SendMessage ¶
func (*FakePMAPI) SendSimpleMetric ¶
func (*FakePMAPI) UnlabelMessages ¶
func (*FakePMAPI) UpdateLabel ¶
Click to show internal directories.
Click to hide internal directories.