Documentation ¶
Index ¶
- Constants
- Variables
- type Backend
- func (b *Backend) CheckPlain(username, password string) bool
- func (b *Backend) Close() error
- func (b *Backend) CreateMessageLimit() *uint32
- func (b *Backend) CreateUser(username, password string) error
- func (b *Backend) DeleteUser(username string) error
- func (b *Backend) EnableChildrenExt() bool
- func (b *Backend) GetOrCreateUser(username string) (backend.User, error)
- func (b *Backend) GetUser(username string) (backend.User, error)
- func (b *Backend) ListUsers() ([]string, error)
- func (b *Backend) Login(_ *imap.ConnInfo, username, password string) (backend.User, error)
- func (b *Backend) SetMessageLimit(val *uint32) error
- func (b *Backend) SetUserPassword(username, newPassword string) error
- func (b *Backend) Updates() <-chan backend.Update
- func (b *Backend) UserCreds(username string) (uint64, []byte, []byte, error)
- type ExternalStore
- type Mailbox
- func (m *Mailbox) Check() error
- func (m *Mailbox) CopyMessages(uid bool, seqset *imap.SeqSet, dest string) error
- func (m *Mailbox) CreateMessage(flags []string, date time.Time, fullBody imap.Literal) error
- func (m *Mailbox) CreateMessageLimit() *uint32
- func (m *Mailbox) DelMessages(uid bool, seqset *imap.SeqSet) error
- func (m *Mailbox) Expunge() error
- func (m *Mailbox) Info() (*imap.MailboxInfo, error)
- func (m *Mailbox) ListMessages(uid bool, seqset *imap.SeqSet, items []imap.FetchItem, ch chan<- *imap.Message) error
- func (m *Mailbox) MoveMessages(uid bool, seqset *imap.SeqSet, dest string) error
- func (m *Mailbox) Name() string
- func (m *Mailbox) SearchMessages(uid bool, criteria *imap.SearchCriteria) ([]uint32, error)
- func (m *Mailbox) SetMessageLimit(val *uint32) error
- func (m *Mailbox) SetSubscribed(subscribed bool) error
- func (m *Mailbox) Status(items []imap.StatusItem) (*imap.MailboxStatus, error)
- func (m *Mailbox) UidNext(tx *sql.Tx) (uint32, error)
- func (m *Mailbox) UpdateMessagesFlags(uid bool, seqset *imap.SeqSet, operation imap.FlagsOp, flags []string) error
- type Opts
- type Rand
- type User
- func (u *User) CreateMailbox(name string) error
- func (u *User) CreateMessageLimit() *uint32
- func (u *User) DeleteMailbox(name string) error
- func (u *User) GetMailbox(name string) (backend.Mailbox, error)
- func (u *User) ID() uint64
- func (u *User) ListMailboxes(subscribed bool) ([]backend.Mailbox, error)
- func (u *User) Logout() error
- func (u *User) RenameMailbox(existingName, newName string) error
- func (u *User) SetMessageLimit(val *uint32) error
- func (u *User) Username() string
Constants ¶
View Source
const MailboxPathSep = "."
View Source
const SchemaVersion = 2
Incremented each time DB schema changes.
View Source
const VersionMajor = 0
View Source
const VersionMinor = 1
View Source
const VersionPatch = 0
View Source
const VersionStr = "0.2"
View Source
const VersionSuppl = ""
Variables ¶
View Source
var ( ErrUserAlreadyExists = errors.New("imap: user already exists") ErrUserDoesntExists = errors.New("imap: user doesn't exists") )
Functions ¶
This section is empty.
Types ¶
type Backend ¶ added in v0.2.0
func (*Backend) CheckPlain ¶ added in v0.2.0
func (*Backend) CreateMessageLimit ¶ added in v0.2.0
func (*Backend) CreateUser ¶ added in v0.2.0
func (*Backend) DeleteUser ¶ added in v0.2.0
func (*Backend) EnableChildrenExt ¶ added in v0.2.0
func (*Backend) GetOrCreateUser ¶ added in v0.2.0
func (*Backend) SetMessageLimit ¶ added in v0.2.0
func (*Backend) SetUserPassword ¶ added in v0.2.0
type ExternalStore ¶ added in v0.2.0
type ExternalStore interface { Create(key string) (io.WriteCloser, error) Open(key string) (io.ReadCloser, error) Delete(keys []string) error }
ExternalStore is an interface used by go-imap-sql to store message bodies outside of main database.
type Mailbox ¶ added in v0.2.0
type Mailbox struct {
// contains filtered or unexported fields
}
func (*Mailbox) CopyMessages ¶ added in v0.2.0
func (*Mailbox) CreateMessage ¶ added in v0.2.0
func (*Mailbox) CreateMessageLimit ¶ added in v0.2.0
func (*Mailbox) DelMessages ¶ added in v0.2.0
func (*Mailbox) ListMessages ¶ added in v0.2.0
func (*Mailbox) MoveMessages ¶ added in v0.2.0
func (*Mailbox) SearchMessages ¶ added in v0.2.0
func (*Mailbox) SetMessageLimit ¶ added in v0.2.0
func (*Mailbox) SetSubscribed ¶ added in v0.2.0
type Opts ¶ added in v0.2.0
type Opts struct { // Maximum amount of bytes that backend will accept. // Intended for use with APPENDLIMIT extension. // nil value means no limit, 0 means zero limit (no new messages allowed) MaxMsgBytes *uint32 // Controls when channel returned by Updates should be created. // If set to false - channel will be created before NewBackend returns. // If set to true - channel will be created upon first call to Updates. // Second is useful for tests that don't consume values from Updates // channel. LazyUpdatesInit bool // UpdatesChan allows to pass custom channel object used for unilateral // updates dispatching. // // You can use this to change default updates buffer size (20) or to split // initializaton into phases (which allows to break circular dependencies // if you need updates channel before database initialization). UpdatesChan chan backend.Update // Custom randomness source for UIDVALIDITY values generation. PRNG Rand // (SQLite3 only) Don't force WAL journaling mode. NoWAL bool // (SQLite3 only) Use different value for busy_timeout. Default is 50000. // To set to 0, use -1 (you probably don't want this). BusyTimeout int // (SQLite3 only) Use EXCLUSIVE locking mode. ExclusiveLock bool // (SQLite3 only) Change page cache size. Positive value indicates cache // size in pages, negative in KiB. If set 0 - SQLite default will be used. CacheSize int // (SQLite3 only) Repack database file into minimal amount of disk space on // Close. // It runs VACUUM and PRAGMA wal_checkpoint(TRUNCATE). MinimizeOnClose bool // External storage to use to store message bodies. If specified - all new messages // will be saved to it. However, already existing messages stored in DB // directly will not be moved. ExternalStore ExternalStore // Automatically update database schema on imapsql.New. AllowSchemaUpgrade bool }
Opts structure specifies additional settings that may be set for backend.
Please use names to reference structure members on creation, fields may be reordered or added without major version increment.
type User ¶ added in v0.2.0
type User struct {
// contains filtered or unexported fields
}
func (*User) CreateMailbox ¶ added in v0.2.0
func (*User) CreateMessageLimit ¶ added in v0.2.0
func (*User) DeleteMailbox ¶ added in v0.2.0
func (*User) GetMailbox ¶ added in v0.2.0
func (*User) ListMailboxes ¶ added in v0.2.0
func (*User) RenameMailbox ¶ added in v0.2.0
func (*User) SetMessageLimit ¶ added in v0.2.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.