Documentation ¶
Index ¶
- Variables
- func Backend_AppendLimit(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_AppendLimit(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_Children(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_CopyMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_CreateMessage(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_Expunge(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_ExpungeUpdate(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_Info(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_ListMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_ListMessages_Body(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_ListMessages_BodyPeek(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_ListMessages_Meta(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_ListMessages_Multi(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_MessageUpdate(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_MonotonicUid(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_MoveMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_SearchMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_SetMessageFlags(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_SetSubscribed(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_Status(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_StatusUpdate(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_StatusUpdate_Copy(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_StatusUpdate_Move(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func Mailbox_UidValidity_On_Rename(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func RunTests(t *testing.T, newBackend NewBackFunc, closeBackend CloseBackFunc)
- func TestInit(t *testing.T, newBackend NewBackFunc, closeBackend CloseBackFunc)
- func UserDB_CreateUser(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func UserDB_DeleteUser(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func UserDB_Login(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func UserDB_SetPassword(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_AppendLimit(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_CreateMailbox(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_CreateMailbox_Parents(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_DeleteMailbox(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_DeleteMailbox_Parents(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_ListMailboxes(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_RenameMailbox(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_RenameMailbox_Childrens(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_RenameMailbox_INBOX(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- func User_Username(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
- type AppendLimitBackend
- type AppendLimitMbox
- type AppendLimitUser
- type Backend
- type CloseBackFunc
- type IMAPUsersDB
- type NewBackFunc
- type UsersDB
Constants ¶
This section is empty.
Variables ¶
var ( ErrUserAlreadyExists = errors.New("imap: user already exists") ErrUserDoesntExists = errors.New("imap: user doesn't exists") )
var Blacklist []string
var Whitelist []string
Functions ¶
func Backend_AppendLimit ¶
func Backend_AppendLimit(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_AppendLimit ¶
func Mailbox_AppendLimit(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_Children ¶
func Mailbox_Children(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_CopyMessages ¶
func Mailbox_CopyMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_CreateMessage ¶
func Mailbox_CreateMessage(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_Expunge ¶
func Mailbox_Expunge(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_ExpungeUpdate ¶
func Mailbox_ExpungeUpdate(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_Info ¶
func Mailbox_Info(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_ListMessages ¶
func Mailbox_ListMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_ListMessages_Body ¶
func Mailbox_ListMessages_Body(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_ListMessages_BodyPeek ¶
func Mailbox_ListMessages_BodyPeek(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_ListMessages_Meta ¶
func Mailbox_ListMessages_Meta(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_ListMessages_Multi ¶
func Mailbox_ListMessages_Multi(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_MessageUpdate ¶
func Mailbox_MessageUpdate(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_MonotonicUid ¶
func Mailbox_MonotonicUid(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_MoveMessages ¶
func Mailbox_MoveMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_SearchMessages ¶
func Mailbox_SearchMessages(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_SetMessageFlags ¶
func Mailbox_SetMessageFlags(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_SetSubscribed ¶
func Mailbox_SetSubscribed(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_Status ¶
func Mailbox_Status(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_StatusUpdate ¶
func Mailbox_StatusUpdate(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_StatusUpdate_Copy ¶
func Mailbox_StatusUpdate_Copy(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_StatusUpdate_Move ¶
func Mailbox_StatusUpdate_Move(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func Mailbox_UidValidity_On_Rename ¶
func Mailbox_UidValidity_On_Rename(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func RunTests ¶
func RunTests(t *testing.T, newBackend NewBackFunc, closeBackend CloseBackFunc)
RunTests runs all tests against backend created using passed callback functions.
func TestInit ¶
func TestInit(t *testing.T, newBackend NewBackFunc, closeBackend CloseBackFunc)
func UserDB_CreateUser ¶
func UserDB_CreateUser(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func UserDB_DeleteUser ¶
func UserDB_DeleteUser(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func UserDB_Login ¶
func UserDB_Login(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func UserDB_SetPassword ¶
func UserDB_SetPassword(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_AppendLimit ¶
func User_AppendLimit(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_CreateMailbox ¶
func User_CreateMailbox(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_CreateMailbox_Parents ¶
func User_CreateMailbox_Parents(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_DeleteMailbox ¶
func User_DeleteMailbox(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_DeleteMailbox_Parents ¶
func User_DeleteMailbox_Parents(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_ListMailboxes ¶
func User_ListMailboxes(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_RenameMailbox ¶
func User_RenameMailbox(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_RenameMailbox_Childrens ¶
func User_RenameMailbox_Childrens(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_RenameMailbox_INBOX ¶
func User_RenameMailbox_INBOX(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
func User_Username ¶
func User_Username(t *testing.T, newBack NewBackFunc, closeBack CloseBackFunc)
Types ¶
type AppendLimitBackend ¶
type AppendLimitBackend interface { appendlimit.Backend // SetMessageLimit sets new value for limit. // nil pointer means no limit. SetMessageLimit(val *uint32) error }
AppendLimitBackend is extension for main backend interface (backend.Backend) which allows to set append limit value for testing and administration purposes.
type AppendLimitMbox ¶
type AppendLimitMbox interface { CreateMessageLimit() *uint32 // SetMessageLimit sets new value for limit. // nil pointer means no limit. SetMessageLimit(val *uint32) error }
AppendLimitMbox is extension for backend.Mailbox interface which allows to set append limit value for testing and administration purposes.
type AppendLimitUser ¶
type AppendLimitUser interface { appendlimit.User // SetMessageLimit sets new value for limit. // nil pointer means no limit. SetMessageLimit(val *uint32) error }
AppendLimitUser is extension for backend.User interface which allows to set append limit value for testing and administration purposes.
type Backend ¶
type Backend interface { backend.Backend IMAPUsersDB }
type CloseBackFunc ¶
type CloseBackFunc func(Backend)
CloseBackFunc should clean up Backend object after testing.
Most importantly, it should ensure that all persistent data is removed so next test will get clean state.
type IMAPUsersDB ¶
type NewBackFunc ¶
type NewBackFunc func() Backend
NewBackFunc should create new Backend object configured for testing.
It should ensure that backend object created with each call gets a clean empty state.
type UsersDB ¶
type UsersDB interface { // CreateUser creates new user with specified username. // // No mailboxes are created for new user, even INBOX. This should be done // manually using CreateMailbox. // // It is error to create user which already exists. ErrUserAlreadyExists // will be returned in this case. // // To backend implementers: You need to only return error with same message // for tests to work correctly. CreateUser(username, password string) error // DeleteUser deletes user account from backend storage, along with all // mailboxes and messages. // // It is error to delete user which doesn't exists. ErrUserDoesntExists // will be returned in this case. // // To backend implementers: You need to only return error with same message // for tests to work correctly. DeleteUser(username string) error // SetUserPassword updates password of existsing user. // // It is error to update user which doesn't exists. ErrUserDoesntExists // will be returned in this case. // // To backend implementers: You need to only return error with same message // for tests to work correctly. SetUserPassword(username, newPassword string) error }
UsersDB is additional backend interface that allows external code to perform administrative actions on backend's storage related to users.