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

feat(config): add withFS option to file source #2557

Merged
merged 1 commit into from
Sep 24, 2022

Conversation

asynxc
Copy link
Contributor

@asynxc asynxc commented Sep 23, 2022

This PR introduce a new option to the file module that allow a user either to pass in a file path or FS handler. as argument. (if both options provided, FS handler is used)

This options allow the use of a raw or embed.FS as data source. (e.g: as default config data, overridden by subsequent provided sources).

Any feedback is very welcome ^^

@asynxc asynxc force-pushed the feat/config/source/file/add_withfs branch 2 times, most recently from 0c4a876 to 45fb546 Compare September 23, 2022 15:37
@asynxc asynxc force-pushed the feat/config/source/file/add_withfs branch from 45fb546 to c847dc8 Compare September 23, 2022 15:58
@Davincible Davincible merged commit 39e00f1 into micro:master Sep 24, 2022
@Davincible
Copy link
Contributor

Thanks for the PR!

Just curious, what is your use case for this?

@asynxc
Copy link
Contributor Author

asynxc commented Sep 24, 2022

@Davincible Thanks ^^

working on a project that have a lot of configurations and we want it to have sane defaults. this require us to have a default configurations that gets merged/overridden by other (user) provided files...

with this PR, now we can embed a default config via embed.FS and use it as a source file, without the hustle of handling that in the project codebase.

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.

2 participants