Documentation ¶
Index ¶
- func DeleteSession(user string)
- type Authorizator
- type Backend
- func (b *Backend) ClearLocks() error
- func (b *Backend) Dele(user string, msgId int) error
- func (b *Backend) List(user string) (octets []int, err error)
- func (b *Backend) ListMessage(user string, msgId int) (exists bool, octets int, err error)
- func (b *Backend) Lock(user string) (inUse bool, err error)
- func (b *Backend) Log(s string, loglevel int)
- func (b *Backend) Retr(user string, msgId int) (message string, err error)
- func (b *Backend) Rset(user string) error
- func (b *Backend) Stat(user string) (messages, octets int, err error)
- func (b *Backend) TopMessage(user string, msgId, msgLines int) (exists bool, message string, err error)
- func (b *Backend) Uidl(user string) (uids []string, err error)
- func (b *Backend) UidlMessage(user string, msgId int) (exists bool, uid string, err error)
- func (b *Backend) Unlock(user string) error
- func (b *Backend) Update(user string) error
- type Message
- type Pop3d
- type Session
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteSession ¶
func DeleteSession(user string)
Types ¶
type Authorizator ¶
type Authorizator struct { }
Authorizator is a authorizator interface implementation
func (Authorizator) Authorize ¶
func (a Authorizator) Authorize(user, pass string) bool
Authorize user for given username and password.
type Backend ¶
type Backend struct{}
Backend is a backend interface implementation
func NewBackend ¶
func NewBackend() *Backend
func (*Backend) ClearLocks ¶
ClearLocks deletes all stuck lock files in all users mail directories. It's caled at pop3 server start only.
func (*Backend) Dele ¶
Delete message by message ID - message should be just marked as deleted until Update() is called. Be aware that after Dele() is called, functions like List() etc. should ignore all these messages even if Update() hasn't been called yet
func (*Backend) ListMessage ¶
Returns whether message exists and if yes, then return size of the message in bytes (octets)
func (*Backend) Lock ¶
Lock is called immediately after client is connected. The best way what to use Lock() for is to read all the messages into cache after client is connected. If another user tries to lock the storage, you should return an error to avoid data race.
func (*Backend) Retr ¶
Retrieve whole message by ID - note that message ID is a message position returned by List() function, so be sure to keep that order unchanged while client is connected See Lock() function for more details
func (*Backend) Stat ¶
Returns total message count and total mailbox size in bytes (octets). Deleted messages are ignored.
func (*Backend) TopMessage ¶
func (b *Backend) TopMessage(user string, msgId, msgLines int) (exists bool, message string, err error)
Similar to TopMessage, but returns unique ID by message ID instead of size.
func (*Backend) Uidl ¶
List of unique IDs of all message, similar to List(), but instead of size there is a unique ID which persists the same across all connections. Uid (unique id) is used to allow client to be able to keep messages on the server.
func (*Backend) UidlMessage ¶
Similar to ListMessage, but returns unique ID by message ID instead of size.