Replies: 1 comment
-
Hi @mnako Having further used I think it would be useful to allow:
The first two would considerably speed up header-only or inline text-only use-cases. Many of the recent mbox or maildir message parsers I've come across return an io.Reader for each message, for example the Proton mbox reader. Consequently each of these parsers should, in my view, take an io.Reader. A further bonus request is to export package error types, such as |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This might be only valid to my use case, but I only need to read the headers of a lot of emails.
I can imagine a few ways of doing this:
ParseEmailHeader
this might need to make the body unreadable
NewParseEmailConfig
funcreturning a
*Config
struct off which you could runParseEmail
(parsing only headers if this option is set)ParseEmail
So a few thoughts about the last option...
With a nod towards Dave Cheney's "Functional options for friendly APIs" I wonder if adding a variadic option struct or (better) functional options I wondered if you might consider adding some config options.
A quick hack as follows dropped my processing time to 1/10th of the time in comparison to full email parsing for about 1700 messages. (Please note this is not a proposal for the actual config code!).
Beta Was this translation helpful? Give feedback.
All reactions