Add transform resolver wiring
This commit is contained in:
@@ -44,6 +44,7 @@ func runConfig(ctx context.Context, cfg config.Config, options RunOptions) error
|
||||
summary := runSummary{dryRun: options.DryRun}
|
||||
var failures runFailures
|
||||
backends := newBackendFactory()
|
||||
transforms := newTransformRegistry()
|
||||
if options.Stdout != nil {
|
||||
if _, err := fmt.Fprintf(options.Stdout, "Configured pipelines: %d\n", len(cfg.Pipelines)); err != nil {
|
||||
return err
|
||||
@@ -83,6 +84,7 @@ func runConfig(ctx context.Context, cfg config.Config, options RunOptions) error
|
||||
DestinationBundlePath: sourceBundle.RootRelativePath,
|
||||
Publish: *destination.Publish,
|
||||
Transform: destination.Transform,
|
||||
Transformers: transforms,
|
||||
Transfer: destination.Transfer,
|
||||
DistributorVersion: Version,
|
||||
}
|
||||
|
||||
12
internal/app/transforms.go
Normal file
12
internal/app/transforms.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/transform"
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/transform/markdown"
|
||||
)
|
||||
|
||||
func newTransformRegistry() *transform.Registry {
|
||||
registry := transform.NewRegistry()
|
||||
_ = registry.Register(transform.MarkdownToHTML, markdown.New())
|
||||
return registry
|
||||
}
|
||||
Reference in New Issue
Block a user