Documentation ¶
Index ¶
- Constants
- type Controller
- func (ctl *Controller) AddUser(account *accounts.TestAccount) 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) GetAuthClient(username string) pmapi.Client
- 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) LockEvents()
- 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) UnlockEvents()
- func (ctl *Controller) WasCalled(method, path string, expectedRequest []byte) bool
- func (ctl *Controller) WasCalledRegex(methodRegex, pathRegex string, expectedRequest []byte) (bool, error)
- type FakePMAPI
- func (api *FakePMAPI) AddAuthRefreshHandler(handler pmapi.AuthRefreshHandler)
- func (api *FakePMAPI) Addresses() pmapi.AddressList
- func (api *FakePMAPI) Auth2FA(_ context.Context, twoFactorCode string) error
- func (api *FakePMAPI) AuthDelete(_ context.Context) error
- func (api *FakePMAPI) AuthSalt(_ context.Context) (string, error)
- func (api *FakePMAPI) CloseConnections()
- func (api *FakePMAPI) CountMessages(_ context.Context, addressID string) ([]*pmapi.MessagesCount, error)
- func (api *FakePMAPI) CreateAttachment(_ context.Context, attachment *pmapi.Attachment, data io.Reader, ...) (*pmapi.Attachment, error)
- func (api *FakePMAPI) CreateDraft(ctx context.Context, message *pmapi.Message, parentID string, action int) (*pmapi.Message, error)
- func (api *FakePMAPI) CreateLabel(_ context.Context, label *pmapi.Label) (*pmapi.Label, error)
- func (api *FakePMAPI) CurrentUser(ctx context.Context) (*pmapi.User, error)
- func (api *FakePMAPI) DecryptAndVerifyCards(cards []pmapi.Card) ([]pmapi.Card, error)
- func (api *FakePMAPI) DeleteLabel(_ context.Context, labelID string) error
- func (api *FakePMAPI) DeleteMessages(_ context.Context, apiIDs []string) error
- func (api *FakePMAPI) DownloadAndVerify(string, string, *crypto.KeyRing) (io.Reader, error)
- func (api *FakePMAPI) EmptyFolder(_ context.Context, labelID string, addressID string) error
- func (api *FakePMAPI) GetAddresses(context.Context) (pmapi.AddressList, error)
- func (api *FakePMAPI) GetAttachment(_ context.Context, attachmentID string) (io.ReadCloser, error)
- func (api *FakePMAPI) GetContactByID(_ context.Context, contactID string) (pmapi.Contact, error)
- func (api *FakePMAPI) GetContactEmailByEmail(_ context.Context, email string, page int, pageSize int) ([]pmapi.ContactEmail, error)
- func (api *FakePMAPI) GetCurrentAuth() *pmapi.Auth
- func (api *FakePMAPI) GetEvent(_ context.Context, eventID string) (*pmapi.Event, error)
- func (api *FakePMAPI) GetMailSettings(context.Context) (pmapi.MailSettings, error)
- func (api *FakePMAPI) GetMessage(_ context.Context, apiID string) (*pmapi.Message, error)
- func (api *FakePMAPI) GetPublicKeysForEmail(_ context.Context, email string) (keys []pmapi.PublicKey, internal bool, err error)
- func (api *FakePMAPI) Import(_ context.Context, importMessageRequests pmapi.ImportMsgReqs) ([]*pmapi.ImportMsgRes, error)
- func (api *FakePMAPI) IsUnlocked() bool
- func (api *FakePMAPI) KeyRingForAddressID(addrID string) (*crypto.KeyRing, error)
- func (api *FakePMAPI) LabelMessages(_ context.Context, apiIDs []string, labelID string) error
- func (api *FakePMAPI) ListLabels(context.Context) ([]*pmapi.Label, error)
- func (api *FakePMAPI) ListMessages(_ context.Context, filter *pmapi.MessagesFilter) ([]*pmapi.Message, int, error)
- func (api *FakePMAPI) MarkMessagesRead(_ context.Context, apiIDs []string) error
- func (api *FakePMAPI) MarkMessagesUnread(_ context.Context, apiIDs []string) error
- func (api *FakePMAPI) ReloadKeys(ctx context.Context, passphrase []byte) (err error)
- func (api *FakePMAPI) ReorderAddresses(_ context.Context, addressIDs []string) error
- func (api *FakePMAPI) SendMessage(ctx context.Context, messageID string, ...) (sent, parent *pmapi.Message, err error)
- func (api *FakePMAPI) UnlabelMessages(_ context.Context, apiIDs []string, labelID string) error
- func (api *FakePMAPI) Unlock(_ context.Context, passphrase []byte) (err error)
- func (api *FakePMAPI) UpdateLabel(_ context.Context, label *pmapi.Label) (*pmapi.Label, error)
- func (api *FakePMAPI) UpdateUser(context.Context) (*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
}
Controller implements dummy PMAPIController interface without actual endpoint.
func NewController ¶
func NewController() (*Controller, pmapi.Manager)
func (*Controller) AddUser ¶
func (ctl *Controller) AddUser(account *accounts.TestAccount) error
func (*Controller) AddUserLabel ¶
func (ctl *Controller) AddUserLabel(username string, label *pmapi.Label) error
func (*Controller) AddUserMessage ¶
func (*Controller) GetAuthClient ¶ added in v1.8.7
func (ctl *Controller) GetAuthClient(username string) pmapi.Client
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) LockEvents ¶ added in v1.8.12
func (ctl *Controller) LockEvents()
LockEvents doesn't needs to be implemented for fakeAPI.
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()
func (*Controller) UnlockEvents ¶ added in v1.8.12
func (ctl *Controller) UnlockEvents()
UnlockEvents doesn't needs to be implemented for fakeAPI.
func (*Controller) WasCalled ¶
func (ctl *Controller) WasCalled(method, path string, expectedRequest []byte) bool
func (*Controller) WasCalledRegex ¶ added in v1.8.10
func (ctl *Controller) WasCalledRegex(methodRegex, pathRegex string, expectedRequest []byte) (bool, error)
type FakePMAPI ¶
type FakePMAPI struct {
// contains filtered or unexported fields
}
func (*FakePMAPI) AddAuthRefreshHandler ¶ added in v1.8.0
func (api *FakePMAPI) AddAuthRefreshHandler(handler pmapi.AuthRefreshHandler)
func (*FakePMAPI) Addresses ¶
func (api *FakePMAPI) Addresses() pmapi.AddressList
func (*FakePMAPI) AuthDelete ¶ added in v1.8.0
func (*FakePMAPI) CloseConnections ¶
func (api *FakePMAPI) CloseConnections()
func (*FakePMAPI) CountMessages ¶
func (*FakePMAPI) CreateAttachment ¶
func (*FakePMAPI) CreateDraft ¶
func (*FakePMAPI) CreateLabel ¶
func (*FakePMAPI) CurrentUser ¶
func (*FakePMAPI) DecryptAndVerifyCards ¶
func (*FakePMAPI) DeleteLabel ¶
func (*FakePMAPI) DeleteMessages ¶
func (*FakePMAPI) DownloadAndVerify ¶ added in v1.6.3
func (*FakePMAPI) EmptyFolder ¶
func (*FakePMAPI) GetAddresses ¶
func (*FakePMAPI) GetAttachment ¶
func (*FakePMAPI) GetContactByID ¶
func (*FakePMAPI) GetContactEmailByEmail ¶
func (*FakePMAPI) GetCurrentAuth ¶ added in v1.8.7
func (*FakePMAPI) GetMailSettings ¶
func (*FakePMAPI) GetMessage ¶
func (*FakePMAPI) GetPublicKeysForEmail ¶
func (*FakePMAPI) Import ¶
func (api *FakePMAPI) Import(_ context.Context, importMessageRequests pmapi.ImportMsgReqs) ([]*pmapi.ImportMsgRes, error)
func (*FakePMAPI) IsUnlocked ¶
func (*FakePMAPI) KeyRingForAddressID ¶
func (*FakePMAPI) LabelMessages ¶
func (*FakePMAPI) ListLabels ¶
func (*FakePMAPI) ListMessages ¶
func (api *FakePMAPI) ListMessages(_ context.Context, filter *pmapi.MessagesFilter) ([]*pmapi.Message, int, error)
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) SendMessage ¶
func (*FakePMAPI) UnlabelMessages ¶
func (*FakePMAPI) UpdateLabel ¶
Click to show internal directories.
Click to hide internal directories.