Documentation ¶
Overview ¶
Package mailbox provides mailbox handlers for a fbb.Session.
Index ¶
- Constants
- func DefaultAppDir() (string, error)
- func DefaultMailboxPath() (string, error)
- func IsUnread(msg *fbb.Message) bool
- func LoadMessageDir(dirPath string) ([]*fbb.Message, error)
- func OpenMessage(path string) (*fbb.Message, error)
- func SetUnread(msg *fbb.Message, unread bool) error
- func UserPath(root, callsign string) string
- type DirHandler
- func (h *DirHandler) AddOut(msg *fbb.Message) error
- func (h *DirHandler) Archive() ([]*fbb.Message, error)
- func (h *DirHandler) ArchiveCount() int
- func (h *DirHandler) GetInboundAnswer(p fbb.Proposal) fbb.ProposalAnswer
- func (h *DirHandler) GetOutbound(fws ...fbb.Address) []*fbb.Message
- func (h *DirHandler) Inbox() ([]*fbb.Message, error)
- func (h *DirHandler) InboxCount() int
- func (h *DirHandler) Outbox() ([]*fbb.Message, error)
- func (h *DirHandler) OutboxCount() int
- func (h *DirHandler) Prepare() (err error)
- func (h *DirHandler) ProcessInbound(msgs ...*fbb.Message) (err error)
- func (h *DirHandler) Sent() ([]*fbb.Message, error)
- func (h *DirHandler) SentCount() int
- func (h *DirHandler) SetDeferred(MID string)
- func (h *DirHandler) SetSent(MID string, rejected bool)
Constants ¶
View Source
const ( DIR_INBOX = "/in/" DIR_OUTBOX = "/out/" DIR_SENT = "/sent/" DIR_ARCHIVE = "/archive/" )
View Source
const Ext = ".b2f"
Variables ¶
This section is empty.
Functions ¶
func DefaultAppDir ¶
func DefaultMailboxPath ¶
func OpenMessage ¶
OpenMessage opens a single a fbb.Message file.
Types ¶
type DirHandler ¶
type DirHandler struct { MBoxPath string // contains filtered or unexported fields }
NewDirHandler is a file system (directory) oriented mailbox handler.
func NewDirHandler ¶
func NewDirHandler(path string, sendOnly bool) *DirHandler
NewDirHandler wraps the directory given by path as a DirHandler.
If sendOnly is true, all inbound messages will be deferred.
func (*DirHandler) ArchiveCount ¶
func (h *DirHandler) ArchiveCount() int
func (*DirHandler) GetInboundAnswer ¶
func (h *DirHandler) GetInboundAnswer(p fbb.Proposal) fbb.ProposalAnswer
func (*DirHandler) GetOutbound ¶
func (h *DirHandler) GetOutbound(fws ...fbb.Address) []*fbb.Message
func (*DirHandler) InboxCount ¶
func (h *DirHandler) InboxCount() int
InboxCount returns the number of messages in the inbox. -1 on error.
func (*DirHandler) OutboxCount ¶
func (h *DirHandler) OutboxCount() int
func (*DirHandler) Prepare ¶
func (h *DirHandler) Prepare() (err error)
func (*DirHandler) ProcessInbound ¶
func (h *DirHandler) ProcessInbound(msgs ...*fbb.Message) (err error)
func (*DirHandler) SentCount ¶
func (h *DirHandler) SentCount() int
func (*DirHandler) SetDeferred ¶
func (h *DirHandler) SetDeferred(MID string)
func (*DirHandler) SetSent ¶
func (h *DirHandler) SetSent(MID string, rejected bool)
Click to show internal directories.
Click to hide internal directories.