Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support attachments/embeds via io/fs.FS #376

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

wneessen
Copy link
Owner

This PR adds support for generic file systems that satisfy the fs.FS interface. Since embed.FS is such a file system, the embed.FS has been refactored to make use of the more generic fs.FS code. It also introduces two new methods Msg.AttachFromIOFS and Msg.EmbedFromIOFS. Documentation and tests have been updated accordingly.

Updated functions to use the io/fs package instead of embed.FS, making the code more flexible with respect to different filesystem implementations. Revised the method signatures and related documentation to reflect this change.
Introduce new methods AttachFromIOFS and EmbedFromIOFS to handle attachments and embeds from a general file system (fs.FS). Updated tests to cover these new functionalities and modified error messages for consistency. Updated README to reflect support for fs.FS.
Copy link

codecov bot commented Nov 19, 2024

Codecov Report

Attention: Patch coverage is 92.30769% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.68%. Comparing base (bcc3252) to head (101a35f).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
msg.go 92.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #376      +/-   ##
==========================================
+ Coverage   96.54%   96.68%   +0.14%     
==========================================
  Files          27       27              
  Lines        3038     3051      +13     
==========================================
+ Hits         2933     2950      +17     
+ Misses         73       70       -3     
+ Partials       32       31       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@wneessen wneessen merged commit f37ab24 into main Nov 19, 2024
28 of 29 checks passed
@wneessen wneessen deleted the feature/embed-fs-to-io-fs branch November 22, 2024 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant