mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 20:56:51 +00:00
GODT-1779: Remove go-imap
This commit is contained in:
36
tests/api_test.go
Normal file
36
tests/api_test.go
Normal file
@ -0,0 +1,36 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"github.com/Masterminds/semver/v3"
|
||||
"github.com/ProtonMail/gluon/rfc822"
|
||||
"gitlab.protontech.ch/go/liteapi"
|
||||
"gitlab.protontech.ch/go/liteapi/server"
|
||||
)
|
||||
|
||||
type API interface {
|
||||
SetMinAppVersion(*semver.Version)
|
||||
|
||||
GetHostURL() string
|
||||
AddCallWatcher(func(server.Call), ...string)
|
||||
|
||||
AddUser(username, password, address string) (userID, addrID string, err error)
|
||||
RevokeUser(userID string) error
|
||||
|
||||
GetLabels(userID string) ([]liteapi.Label, error)
|
||||
AddLabel(userID, name string, labelType liteapi.LabelType) (string, error)
|
||||
|
||||
GetMessages(userID string) ([]liteapi.Message, error)
|
||||
AddMessage(userID, addrID string, labelIDs []string, sender, recipient, subject, body string, mimeType rfc822.MIMEType, read, starred bool) (string, error)
|
||||
|
||||
Close()
|
||||
}
|
||||
|
||||
type fakeAPI struct {
|
||||
*server.Server
|
||||
}
|
||||
|
||||
func newFakeAPI() *fakeAPI {
|
||||
return &fakeAPI{
|
||||
Server: server.NewTLS(),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user