Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEmailIds ¶
func GetEmailIds(c imapClient, sc *imap.SearchCriteria) []uint32
GetEmailIds will return a slice of uint32 ids for each message within an inbox, provided a particular search criteria. Each ID is a reference to a given message.
func LoadCompletedBooks ¶
LoadCompletedBooks returns a mapping between the book title and a blank value. A book key being within the mapping indicates that it has been read, it is therefore skipped if it is noticed on the next pass of parsing email attachments.
func Save ¶
Save will write the titles which have been written into a 'completed notebooks' file of key-value pairs, this is done in order to avoid parsing the same titles multiple times when they have already been processed.
Types ¶
type Note ¶
Note is a struct which contains a singular record about a note or highlight from a particular book. The difference between a note and a highlight is that a highlight has no annotation.
type Notes ¶
Notes are the overarching struct for the program. This encapsulates a slice of 'Note', which is the various records of information that a person has jotted down about a book, including other metadata pertaining to it.
func New ¶
func New() *Notes
New returns a default Notes struct with none of the fields populated, this is ready to be used throughout the program.
func (*Notes) GetAmazonMessage ¶
func (n *Notes) GetAmazonMessage(c imapClient, id uint32, section imap.BodySectionName) <-chan *imap.Message
GetAmazonMessage takes a singular ID and places it into a buffered channel, returning that channel to be read from once it has completed its work.
func (*Notes) GetMailReaders ¶
func (n *Notes) GetMailReaders(messages <-chan *imap.Message, section imap.BodySectionName) []*mail.Reader
GetMailReaders reads from the channel that was passed in as a result of the `GetAmazonMessage` function, this function is what enables the parsing of the actual content, such as attachments and other metadata.