jordan-wright / email

Robust and flexible email library for Go
MIT License
2.61k stars 324 forks source link

Streaming attachments instead of their fetching into buffers #157

Open YuriiRubakha opened 10 months ago

YuriiRubakha commented 10 months ago

In some use cases attachment data is streamed from external source. Fetching this data into buffers causes additional memory consumption, which may be significant for massive emails sending. To solve this we propose to stream attachments data directly from readers, as they provided by external interface of package (no external interface change).

Internal structures changed accordingly. Some tests changed also to match the new Attachment struct.

No significant negative impact on performance.