Documentation ¶
Index ¶
- Variables
- func SortThreadsBy(toSort []*Thread, sortBy []models.UID)
- func StrategyStrs() []string
- type AnsweredMessages
- type AppendMessage
- type Backend
- type ByUID
- type Cancelled
- type CheckMail
- type CheckMailDirectories
- type Configure
- type ConnError
- type Connect
- type CopyMessages
- type CreateDirectory
- type DeleteMessages
- type Directory
- type DirectoryContents
- type DirectoryInfo
- type DirectoryThreaded
- type Disconnect
- type Done
- type Error
- type FetchDirectoryContents
- type FetchDirectoryThreaded
- type FetchFullMessages
- type FetchMessageBodyPart
- type FetchMessageFlags
- type FetchMessageHeaders
- type FlagMessages
- type ForwardedMessages
- type FullMessage
- type LabelList
- type ListDirectories
- type Message
- type MessageBodyPart
- type MessageInfo
- type MessageWriter
- type MessagesCopied
- type MessagesDeleted
- type MessagesMoved
- type ModifyLabels
- type MoveMessages
- type MultiFileStrategy
- type NewThreadWalkFn
- type OpenDirectory
- type Reconnect
- type RemoveDirectory
- type SearchCriteria
- type SearchDirectory
- type SearchResults
- type SortCriterion
- type SortField
- type StartSendingMessage
- type Thread
- func (t *Thread) AddChild(child *Thread)
- func (t *Thread) InsertCmp(child *Thread, bigger func(*Thread, *Thread) bool)
- func (t *Thread) OrderedInsert(child *Thread)
- func (t *Thread) Root() *Thread
- func (t *Thread) String() string
- func (t *Thread) Uids() []models.UID
- func (t *Thread) Walk(walkFn NewThreadWalkFn) error
- type Unsupported
- type Worker
- func (worker *Worker) Actions() chan WorkerMessage
- func (worker *Worker) PathSeparator() string
- func (worker *Worker) PostAction(msg WorkerMessage, cb func(msg WorkerMessage))
- func (worker *Worker) PostMessage(msg WorkerMessage, cb func(msg WorkerMessage))
- func (worker *Worker) ProcessAction(msg WorkerMessage) WorkerMessage
- func (worker *Worker) ProcessMessage(msg WorkerMessage) WorkerMessage
- func (worker *Worker) Unwrap() WorkerInteractor
- type WorkerInteractor
- type WorkerMessage
Constants ¶
This section is empty.
Variables ¶
var ErrSkipThread = errors.New("skip this Thread")
var StrToStrategy = map[string]MultiFileStrategy{ "refuse": Refuse, "act-all": ActAll, "act-one": ActOne, "act-one-delete-rest": ActOneDelRest, "act-dir": ActDir, "act-dir-delete-rest": ActDirDelRest, }
var WorkerMessages = make(chan WorkerMessage, 50)
Functions ¶
func SortThreadsBy ¶
func StrategyStrs ¶
func StrategyStrs() []string
Types ¶
type AppendMessage ¶
type Backend ¶
type Backend interface { Run() Capabilities() *models.Capabilities PathSeparator() string }
type ByUID ¶
type ByUID []*Thread
Implement interface to be able to sort threads by newest (max UID)
type CheckMailDirectories ¶
type Configure ¶
type Configure struct { Message Config *config.AccountConfig }
type CopyMessages ¶
type CopyMessages struct { Message Destination string Uids []models.UID MultiFileStrategy *MultiFileStrategy }
type CreateDirectory ¶
type DeleteMessages ¶
type DeleteMessages struct { Message Uids []models.UID MultiFileStrategy *MultiFileStrategy }
type DirectoryContents ¶
type DirectoryInfo ¶
type DirectoryInfo struct { Message Info *models.DirectoryInfo Refetch bool }
type DirectoryThreaded ¶
type Disconnect ¶
type Disconnect struct {
Message
}
type FetchDirectoryContents ¶
type FetchDirectoryContents struct { Message Context context.Context SortCriteria []*SortCriterion Filter *SearchCriteria }
type FetchDirectoryThreaded ¶
type FetchDirectoryThreaded struct { Message Context context.Context SortCriteria []*SortCriterion Filter *SearchCriteria ThreadContext bool }
type FetchFullMessages ¶
type FetchMessageFlags ¶
type FetchMessageHeaders ¶
type FlagMessages ¶
Flag messages with different mail types
type FullMessage ¶
type FullMessage struct { Message Content *models.FullMessage }
type ListDirectories ¶
type ListDirectories struct {
Message
}
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func RespondTo ¶
func RespondTo(msg WorkerMessage) Message
func (Message) InResponseTo ¶
func (m Message) InResponseTo() WorkerMessage
type MessageBodyPart ¶
type MessageBodyPart struct { Message Part *models.MessageBodyPart }
type MessageInfo ¶
type MessageInfo struct { Message Info *models.MessageInfo NeedsFlags bool }
type MessageWriter ¶
type MessageWriter struct { Message Writer io.WriteCloser }
type MessagesDeleted ¶
type ModifyLabels ¶
type MoveMessages ¶
type MoveMessages struct { Message Destination string Uids []models.UID MultiFileStrategy *MultiFileStrategy }
type MultiFileStrategy ¶
type MultiFileStrategy uint
MultiFileStrategy represents a strategy for taking file-based actions (e.g., move, copy, delete) on messages that are represented by more than one file. These strategies are only used by the notmuch backend but are defined in this package to prevent import cycles.
const ( Refuse MultiFileStrategy = iota ActAll ActOne ActOneDelRest ActDir ActDirDelRest )
type OpenDirectory ¶
type RemoveDirectory ¶
type SearchCriteria ¶
type SearchCriteria struct { WithFlags models.Flags WithoutFlags models.Flags From []string To []string Cc []string Headers textproto.MIMEHeader StartDate time.Time EndDate time.Time SearchBody bool SearchAll bool Terms []string UseExtension bool }
func (*SearchCriteria) Combine ¶
func (c *SearchCriteria) Combine(other *SearchCriteria) *SearchCriteria
func (*SearchCriteria) PrepareHeader ¶
func (c *SearchCriteria) PrepareHeader()
type SearchDirectory ¶
type SearchDirectory struct { Message Context context.Context Criteria *SearchCriteria }
type SearchResults ¶
type SortCriterion ¶
type StartSendingMessage ¶
type Thread ¶
type Thread struct { Uid models.UID Parent *Thread PrevSibling *Thread NextSibling *Thread FirstChild *Thread Hidden int // if this flag is not zero the message isn't rendered in the UI Deleted bool // if this flag is set the message was deleted // if this flag is set the message is the root of an incomplete thread Dummy bool // Context indicates the message doesn't match the mailbox / query but // is displayed for context Context bool }
func (*Thread) InsertCmp ¶
InsertCmp inserts child as a child node into t in ascending order. The ascending order is determined by the bigger function that compares the child with the existing children. It should return true when the child is bigger than the other, and false otherwise.
func (*Thread) OrderedInsert ¶
OrderedInsert inserts the child node in ascending order among the existing children based on their respective UIDs.
func (*Thread) Walk ¶
func (t *Thread) Walk(walkFn NewThreadWalkFn) error
type Unsupported ¶
type Unsupported struct {
Message
}
type Worker ¶
type Worker struct { Backend Backend sync.Mutex log.Logger // contains filtered or unexported fields }
func (*Worker) Actions ¶
func (worker *Worker) Actions() chan WorkerMessage
func (*Worker) PathSeparator ¶
func (*Worker) PostAction ¶
func (worker *Worker) PostAction(msg WorkerMessage, cb func(msg WorkerMessage))
PostAction posts an action to the worker. This method should not be called from the same goroutine that the worker runs in or deadlocks may occur
func (*Worker) PostMessage ¶
func (worker *Worker) PostMessage(msg WorkerMessage, cb func(msg WorkerMessage), )
PostMessage posts an message to the UI. This method should not be called from the same goroutine that the UI runs in or deadlocks may occur
func (*Worker) ProcessAction ¶
func (worker *Worker) ProcessAction(msg WorkerMessage) WorkerMessage
func (*Worker) ProcessMessage ¶
func (worker *Worker) ProcessMessage(msg WorkerMessage) WorkerMessage
func (*Worker) Unwrap ¶
func (worker *Worker) Unwrap() WorkerInteractor
type WorkerInteractor ¶
type WorkerInteractor interface { log.Logger Actions() chan WorkerMessage ProcessAction(WorkerMessage) WorkerMessage PostAction(WorkerMessage, func(msg WorkerMessage)) PostMessage(WorkerMessage, func(msg WorkerMessage)) Unwrap() WorkerInteractor }
type WorkerMessage ¶
type WorkerMessage interface { InResponseTo() WorkerMessage Account() string // contains filtered or unexported methods }