mnako / letters

Letters, or how to parse emails in Go
MIT License
46 stars 9 forks source link

Discussion: options and config/state struct #86

Closed rorycl closed 3 months ago

rorycl commented 3 months ago

As mentioned by @mnako in #85 , a config or state struct might be useful for future maintainability and for different types of operation.

For example, even if ParseHeaders is now a public func, storing the fact that headers have been parsed might be useful if the email is to be revisited, to avoid the need for reparsing.

A list of possible options includes:

Congruent with this idea is storing config and state for partially processed info in a central struct, perhaps an expanded Email struct, which might also permit easy inspection of state and convenient testability.

rorycl commented 3 months ago

I guess this is irrelevant. Closing.