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

Harmonize nested template and datasource config (map config, and URL support) #1410

Merged
merged 1 commit into from May 30, 2022

Conversation

hairyhenderson
Copy link
Owner

@hairyhenderson hairyhenderson commented May 29, 2022

Related to #963, but focuses on file: URLs for now...

This makes a few changes:

  • configuring nested templates in the config file is now identical to datasources (i.e. a map of alias to url/header) - the old form (array of [k=]v strings) is still supported
  • nested template directory expansion now happens later, when the template is parsed
  • nested templates are now read from an injectable fs.FS (using a fsimpl.FSProvider) - this provider is injected into the context.Context early on, in the Main func.

Right now I'm only injecting the filefs provider, for file: URL support, but I don't think there's any major blockers to supporting the rest of the go-fsimpl filesystems. Mostly I didn't want to add too much functionality at the moment.

Signed-off-by: Dave Henderson dhenderson@gmail.com

@hairyhenderson hairyhenderson force-pushed the read-nested-templates-from-fsys branch from 804745e to a4bff58 Compare May 30, 2022 14:54
@hairyhenderson hairyhenderson changed the title Read nested templates from a fs.FS filesystem instead of assuming the local filesystem Harmonize template and datasource config (map config, and URL support) May 30, 2022
@hairyhenderson hairyhenderson force-pushed the read-nested-templates-from-fsys branch from a4bff58 to ea9ecfa Compare May 30, 2022 14:57
@hairyhenderson hairyhenderson changed the title Harmonize template and datasource config (map config, and URL support) Harmonize nested template and datasource config (map config, and URL support) May 30, 2022
@hairyhenderson hairyhenderson self-assigned this May 30, 2022
@hairyhenderson hairyhenderson force-pushed the read-nested-templates-from-fsys branch 2 times, most recently from b130aaa to 4446746 Compare May 30, 2022 15:35
@hairyhenderson hairyhenderson marked this pull request as ready for review May 30, 2022 15:43
@hairyhenderson hairyhenderson force-pushed the read-nested-templates-from-fsys branch 3 times, most recently from f3fb60d to ada1468 Compare May 30, 2022 17:52
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@hairyhenderson hairyhenderson force-pushed the read-nested-templates-from-fsys branch from ada1468 to c0b93d7 Compare May 30, 2022 18:06
@hairyhenderson hairyhenderson merged commit c56cd06 into master May 30, 2022
@hairyhenderson hairyhenderson deleted the read-nested-templates-from-fsys branch May 30, 2022 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant