Documentation ¶
Index ¶
- Constants
- func EqualParts(a []int, b []int) bool
- func FindAllNonMultipart(bs *models.BodyStructure, path []int, pathlist [][]int) [][]int
- func FindCalendartext(bs *models.BodyStructure, path []int) []int
- func FindFirstNonMultipart(bs *models.BodyStructure, path []int) []int
- func FindMIMEPart(mime string, bs *models.BodyStructure, path []int) []int
- func FindMimeType(filename string, reader *bufio.Reader) (string, map[string]string, error)
- func FindPlaintext(bs *models.BodyStructure, path []int) []int
- func GetRefreshToken(acct string) ([]byte, error)
- func NewEmlMessageView(full []byte, pgp crypto.Provider, decryptKeys openpgp.PromptFunction, ...)
- func NewMessageStoreView(messageInfo *models.MessageInfo, setSeen bool, store *MessageStore, ...)
- func NewXoauth2Client(username, token string) sasl.Client
- func NotmuchVersion() (string, bool)
- func SaveRefreshToken(refreshToken string, acct string) error
- func SetTcpKeepaliveInterval(fd, interval int) error
- func SetTcpKeepaliveProbes(fd, count int) error
- func SetUtf8Charset(origParams map[string]string) map[string]string
- func XDGOpenMime(uri string, mimeType string, args string) error
- type Attachment
- type DirStore
- func (store *DirStore) Directory(name string) *models.Directory
- func (store *DirStore) List() []string
- func (store *DirStore) MessageStore(dirname string) (*MessageStore, bool)
- func (store *DirStore) Remove(name string)
- func (store *DirStore) SetMessageStore(dir *models.Directory, msgStore *MessageStore)
- type EmlMessage
- type FileAttachment
- type History
- type MessageStore
- func (store *MessageStore) Answered(uids []models.UID, answered bool, cb func(msg types.WorkerMessage))
- func (store *MessageStore) Append(dest string, flags models.Flags, date time.Time, reader io.Reader, length int, ...)
- func (store *MessageStore) ApplyClear()
- func (store *MessageStore) ApplySearch(results []models.UID)
- func (store *MessageStore) BuildThreads() bool
- func (store *MessageStore) Capabilities() *models.Capabilities
- func (store *MessageStore) Configure(defaultSort []*types.SortCriterion)
- func (store *MessageStore) Copy(uids []models.UID, dest string, createDest bool, mfs *types.MultiFileStrategy, ...)
- func (store *MessageStore) Delete(uids []models.UID, mfs *types.MultiFileStrategy, ...)
- func (store *MessageStore) FetchBodyPart(uid models.UID, part []int, cb func(io.Reader))
- func (store *MessageStore) FetchFull(uids []models.UID, cb func(*types.FullMessage))
- func (store *MessageStore) FetchHeaders(uids []models.UID, cb func(types.WorkerMessage))
- func (store *MessageStore) FindIndexByUid(uid models.UID) int
- func (store *MessageStore) Flag(uids []models.UID, flags models.Flags, enable bool, ...)
- func (store *MessageStore) Fold(uid models.UID, toggle bool) error
- func (store *MessageStore) Forwarded(uids []models.UID, forwarded bool, cb func(msg types.WorkerMessage))
- func (store *MessageStore) GetCurrentSortCriteria() []*types.SortCriterion
- func (store *MessageStore) IsResult(uid models.UID) bool
- func (store *MessageStore) Marker() marker.Marker
- func (store *MessageStore) ModifyLabels(uids []models.UID, add, remove []string, cb func(msg types.WorkerMessage))
- func (store *MessageStore) Move(uids []models.UID, dest string, createDest bool, mfs *types.MultiFileStrategy, ...)
- func (store *MessageStore) Next()
- func (store *MessageStore) NextPrev(delta int)
- func (store *MessageStore) NextResult()
- func (store *MessageStore) OnFilterChange(fn func(store *MessageStore))
- func (store *MessageStore) OnUpdate(fn func(store *MessageStore))
- func (store *MessageStore) OnUpdateDirs(fn func())
- func (store *MessageStore) Prev()
- func (store *MessageStore) PrevResult()
- func (store *MessageStore) ReverseThreadOrder() bool
- func (store *MessageStore) Search(terms *types.SearchCriteria, cb func([]models.UID))
- func (store *MessageStore) Select(uid models.UID)
- func (store *MessageStore) Selected() *models.MessageInfo
- func (store *MessageStore) SelectedIndex() int
- func (store *MessageStore) SelectedThread() (*types.Thread, error)
- func (store *MessageStore) SelectedUid() models.UID
- func (store *MessageStore) SetContext(ctx context.Context)
- func (store *MessageStore) SetFilter(terms *types.SearchCriteria)
- func (store *MessageStore) SetMarker(m marker.Marker)
- func (store *MessageStore) SetThreadedView(thread bool)
- func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.WorkerMessage))
- func (store *MessageStore) Thread(uid models.UID) (*types.Thread, error)
- func (store *MessageStore) ThreadedView() bool
- func (store *MessageStore) ThreadsIterator() iterator.Iterator
- func (store *MessageStore) ToggleThreadContext()
- func (store *MessageStore) Uids() []models.UID
- func (store *MessageStore) UidsIterator() iterator.Iterator
- func (store *MessageStore) Unfold(uid models.UID, toggle bool) error
- func (store *MessageStore) Update(msg types.WorkerMessage)
- func (store *MessageStore) UpdateScroll(offset, length int)
- type MessageStoreView
- func (msv *MessageStoreView) BodyStructure() *models.BodyStructure
- func (msv *MessageStoreView) FetchBodyPart(part []int, cb func(io.Reader))
- func (msv *MessageStoreView) FetchFull(cb func(io.Reader))
- func (msv *MessageStoreView) MessageDetails() *models.MessageDetails
- func (msv *MessageStoreView) MessageInfo() *models.MessageInfo
- func (msv *MessageStoreView) SeenFlagSet() bool
- func (msv *MessageStoreView) Store() *MessageStore
- type MessageView
- type OAuthBearer
- type Part
- type PartAttachment
- type ThreadBuilder
- func (builder *ThreadBuilder) RebuildUids(threads []*types.Thread, inverse bool)
- func (builder *ThreadBuilder) ThreadForUid(uid models.UID) (*types.Thread, error)
- func (builder *ThreadBuilder) Threads(uids []models.UID, inverse bool, sort bool) []*types.Thread
- func (builder *ThreadBuilder) Uids() []models.UID
- func (builder *ThreadBuilder) Update(msg *models.MessageInfo)
- type Xoauth2
- type Xoauth2Error
Constants ¶
const MagicUid = models.UID("")
Variables ¶
This section is empty.
Functions ¶
func EqualParts ¶
func FindAllNonMultipart ¶
func FindAllNonMultipart(bs *models.BodyStructure, path []int, pathlist [][]int) [][]int
func FindCalendartext ¶
func FindCalendartext(bs *models.BodyStructure, path []int) []int
func FindFirstNonMultipart ¶
func FindFirstNonMultipart(bs *models.BodyStructure, path []int) []int
func FindMIMEPart ¶
func FindMIMEPart(mime string, bs *models.BodyStructure, path []int) []int
FindMIMEPart finds the first message part with the provided MIME type. FindMIMEPart recurses inside multipart containers.
func FindMimeType ¶
func FindPlaintext ¶
func FindPlaintext(bs *models.BodyStructure, path []int) []int
func GetRefreshToken ¶
func NewEmlMessageView ¶
func NewEmlMessageView(full []byte, pgp crypto.Provider, decryptKeys openpgp.PromptFunction, cb func(MessageView, error), )
NewEmlMessageView provides a MessageView for a full message that is not stored in a message store
func NewMessageStoreView ¶
func NewMessageStoreView(messageInfo *models.MessageInfo, setSeen bool, store *MessageStore, pgp crypto.Provider, decryptKeys openpgp.PromptFunction, innerCb func(MessageView, error), )
func NewXoauth2Client ¶
func NewXoauth2Client(username, token string) sasl.Client
An implementation of the XOAUTH2 authentication mechanism, as described in https://developers.google.com/gmail/xoauth2_protocol.
func NotmuchVersion ¶
func SaveRefreshToken ¶
func SetTcpKeepaliveInterval ¶
func SetTcpKeepaliveProbes ¶
func SetUtf8Charset ¶
SetUtf8Charset sets the charset in a params map to UTF-8.
Types ¶
type DirStore ¶
type DirStore struct {
// contains filtered or unexported fields
}
func NewDirStore ¶
func NewDirStore() *DirStore
func (*DirStore) MessageStore ¶
func (store *DirStore) MessageStore(dirname string) (*MessageStore, bool)
func (*DirStore) SetMessageStore ¶
func (store *DirStore) SetMessageStore(dir *models.Directory, msgStore *MessageStore)
type EmlMessage ¶
type EmlMessage []byte
EmlMessage implements the RawMessage interface
func (*EmlMessage) Labels ¶
func (fm *EmlMessage) Labels() ([]string, error)
func (*EmlMessage) ModelFlags ¶
func (fm *EmlMessage) ModelFlags() (models.Flags, error)
func (*EmlMessage) NewReader ¶
func (fm *EmlMessage) NewReader() (io.ReadCloser, error)
func (*EmlMessage) UID ¶
func (fm *EmlMessage) UID() models.UID
type FileAttachment ¶
type FileAttachment struct {
// contains filtered or unexported fields
}
func NewFileAttachment ¶
func NewFileAttachment(path string) *FileAttachment
func (*FileAttachment) Name ¶
func (fa *FileAttachment) Name() string
type History ¶
type History interface { // Add a new element to the history Add(string) // Get the next element in history Next() string // Get the previous element in history Prev() string // Reset the current location in history Reset() }
History represents a list of elements ordered by time.
type MessageStore ¶
type MessageStore struct { sync.Mutex Name string Deleted map[models.UID]interface{} Messages map[models.UID]*models.MessageInfo Sorting bool // contains filtered or unexported fields }
Accesses to fields must be guarded by MessageStore.Lock/Unlock
func NewMessageStore ¶
func NewMessageStore(worker *types.Worker, name string, ui func() *config.UIConfig, triggerNewEmail func(*models.MessageInfo), triggerDirectoryChange func(), triggerMailDeleted func(), triggerMailAdded func(string), triggerTagModified func([]string, []string), triggerFlagChanged func(string), onSelect func(*models.MessageInfo), ) *MessageStore
func (*MessageStore) Answered ¶
func (store *MessageStore) Answered(uids []models.UID, answered bool, cb func(msg types.WorkerMessage), )
func (*MessageStore) ApplyClear ¶
func (store *MessageStore) ApplyClear()
func (*MessageStore) ApplySearch ¶
func (store *MessageStore) ApplySearch(results []models.UID)
func (*MessageStore) BuildThreads ¶
func (store *MessageStore) BuildThreads() bool
func (*MessageStore) Capabilities ¶
func (store *MessageStore) Capabilities() *models.Capabilities
Capabilities returns a models.Capabilities struct or nil if not available
func (*MessageStore) Configure ¶
func (store *MessageStore) Configure( defaultSort []*types.SortCriterion, )
func (*MessageStore) Copy ¶
func (store *MessageStore) Copy(uids []models.UID, dest string, createDest bool, mfs *types.MultiFileStrategy, cb func(msg types.WorkerMessage), )
func (*MessageStore) Delete ¶
func (store *MessageStore) Delete(uids []models.UID, mfs *types.MultiFileStrategy, cb func(msg types.WorkerMessage), )
func (*MessageStore) FetchBodyPart ¶
func (*MessageStore) FetchFull ¶
func (store *MessageStore) FetchFull(uids []models.UID, cb func(*types.FullMessage))
func (*MessageStore) FetchHeaders ¶
func (store *MessageStore) FetchHeaders(uids []models.UID, cb func(types.WorkerMessage), )
func (*MessageStore) FindIndexByUid ¶
func (store *MessageStore) FindIndexByUid(uid models.UID) int
FindIndexByUid returns the index in store.Uids() or -1 if not found
func (*MessageStore) Flag ¶
func (store *MessageStore) Flag(uids []models.UID, flags models.Flags, enable bool, cb func(msg types.WorkerMessage), )
func (*MessageStore) Forwarded ¶
func (store *MessageStore) Forwarded(uids []models.UID, forwarded bool, cb func(msg types.WorkerMessage), )
func (*MessageStore) GetCurrentSortCriteria ¶
func (store *MessageStore) GetCurrentSortCriteria() []*types.SortCriterion
func (*MessageStore) IsResult ¶
func (store *MessageStore) IsResult(uid models.UID) bool
IsResult returns true if uid is a search result
func (*MessageStore) Marker ¶
func (store *MessageStore) Marker() marker.Marker
func (*MessageStore) ModifyLabels ¶
func (store *MessageStore) ModifyLabels(uids []models.UID, add, remove []string, cb func(msg types.WorkerMessage), )
func (*MessageStore) Move ¶
func (store *MessageStore) Move(uids []models.UID, dest string, createDest bool, mfs *types.MultiFileStrategy, cb func(msg types.WorkerMessage), )
func (*MessageStore) Next ¶
func (store *MessageStore) Next()
func (*MessageStore) NextPrev ¶
func (store *MessageStore) NextPrev(delta int)
func (*MessageStore) NextResult ¶
func (store *MessageStore) NextResult()
func (*MessageStore) OnFilterChange ¶
func (store *MessageStore) OnFilterChange(fn func(store *MessageStore))
func (*MessageStore) OnUpdate ¶
func (store *MessageStore) OnUpdate(fn func(store *MessageStore))
func (*MessageStore) OnUpdateDirs ¶
func (store *MessageStore) OnUpdateDirs(fn func())
func (*MessageStore) Prev ¶
func (store *MessageStore) Prev()
func (*MessageStore) PrevResult ¶
func (store *MessageStore) PrevResult()
func (*MessageStore) ReverseThreadOrder ¶
func (store *MessageStore) ReverseThreadOrder() bool
func (*MessageStore) Search ¶
func (store *MessageStore) Search(terms *types.SearchCriteria, cb func([]models.UID))
func (*MessageStore) Select ¶
func (store *MessageStore) Select(uid models.UID)
func (*MessageStore) Selected ¶
func (store *MessageStore) Selected() *models.MessageInfo
func (*MessageStore) SelectedIndex ¶
func (store *MessageStore) SelectedIndex() int
SelectedIndex returns the index of the selected message in the uid list or -1 if not found
func (*MessageStore) SelectedThread ¶
func (store *MessageStore) SelectedThread() (*types.Thread, error)
SelectedThread returns the thread with the UID from the selected message
func (*MessageStore) SelectedUid ¶
func (store *MessageStore) SelectedUid() models.UID
func (*MessageStore) SetContext ¶
func (store *MessageStore) SetContext(ctx context.Context)
func (*MessageStore) SetFilter ¶
func (store *MessageStore) SetFilter(terms *types.SearchCriteria)
func (*MessageStore) SetMarker ¶
func (store *MessageStore) SetMarker(m marker.Marker)
func (*MessageStore) SetThreadedView ¶
func (store *MessageStore) SetThreadedView(thread bool)
func (*MessageStore) Sort ¶
func (store *MessageStore) Sort(criteria []*types.SortCriterion, cb func(types.WorkerMessage))
func (*MessageStore) ThreadedView ¶
func (store *MessageStore) ThreadedView() bool
func (*MessageStore) ThreadsIterator ¶
func (store *MessageStore) ThreadsIterator() iterator.Iterator
func (*MessageStore) ToggleThreadContext ¶
func (store *MessageStore) ToggleThreadContext()
func (*MessageStore) Uids ¶
func (store *MessageStore) Uids() []models.UID
func (*MessageStore) UidsIterator ¶
func (store *MessageStore) UidsIterator() iterator.Iterator
func (*MessageStore) Update ¶
func (store *MessageStore) Update(msg types.WorkerMessage)
func (*MessageStore) UpdateScroll ¶
func (store *MessageStore) UpdateScroll(offset, length int)
type MessageStoreView ¶
type MessageStoreView struct {
// contains filtered or unexported fields
}
func (*MessageStoreView) BodyStructure ¶
func (msv *MessageStoreView) BodyStructure() *models.BodyStructure
func (*MessageStoreView) FetchBodyPart ¶
func (msv *MessageStoreView) FetchBodyPart(part []int, cb func(io.Reader))
func (*MessageStoreView) FetchFull ¶
func (msv *MessageStoreView) FetchFull(cb func(io.Reader))
func (*MessageStoreView) MessageDetails ¶
func (msv *MessageStoreView) MessageDetails() *models.MessageDetails
func (*MessageStoreView) MessageInfo ¶
func (msv *MessageStoreView) MessageInfo() *models.MessageInfo
func (*MessageStoreView) SeenFlagSet ¶
func (msv *MessageStoreView) SeenFlagSet() bool
func (*MessageStoreView) Store ¶
func (msv *MessageStoreView) Store() *MessageStore
type MessageView ¶
type MessageView interface { // Returns the MessageInfo for this message MessageInfo() *models.MessageInfo // Returns the BodyStructure for this message BodyStructure() *models.BodyStructure // Returns the message store that this message was originally sourced from Store() *MessageStore // Fetches the full message FetchFull(cb func(io.Reader)) // Fetches a specific body part for this message FetchBodyPart(part []int, cb func(io.Reader)) MessageDetails() *models.MessageDetails // SeenFlagSet returns true if the "seen" flag has been set SeenFlagSet() bool }
This is an abstraction for viewing a message with semi-transparent PGP support.
type OAuthBearer ¶
func (*OAuthBearer) Authenticate ¶
func (*OAuthBearer) ExchangeRefreshToken ¶
func (c *OAuthBearer) ExchangeRefreshToken(refreshToken string) (*oauth2.Token, error)
type Part ¶
type Part struct { MimeType string Params map[string]string Data []byte Converted bool ConversionError error }
type PartAttachment ¶
type PartAttachment struct {
// contains filtered or unexported fields
}
func NewPartAttachment ¶
func NewPartAttachment(part *Part, name string) *PartAttachment
func (*PartAttachment) Name ¶
func (pa *PartAttachment) Name() string
type ThreadBuilder ¶
func NewThreadBuilder ¶
func NewThreadBuilder(i iterator.Factory, bySubject bool) *ThreadBuilder
func (*ThreadBuilder) RebuildUids ¶
func (builder *ThreadBuilder) RebuildUids(threads []*types.Thread, inverse bool)
RebuildUids rebuilds the uids from the given slice of threads
func (*ThreadBuilder) ThreadForUid ¶
func (*ThreadBuilder) Uids ¶
func (builder *ThreadBuilder) Uids() []models.UID
Uids returns the uids in threading order
func (*ThreadBuilder) Update ¶
func (builder *ThreadBuilder) Update(msg *models.MessageInfo)
Update updates the thread builder with a new message header
type Xoauth2 ¶
func (*Xoauth2) Authenticate ¶
type Xoauth2Error ¶
type Xoauth2Error struct { Status string `json:"status"` Schemes string `json:"schemes"` Scope string `json:"scope"` }
An XOAUTH2 error.