Add transform resolver wiring
This commit is contained in:
@@ -9,7 +9,6 @@ import (
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/state"
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/storage"
|
||||
"gitea.maximumdirect.net/eric/distributor/internal/transform"
|
||||
markdowntransform "gitea.maximumdirect.net/eric/distributor/internal/transform/markdown"
|
||||
)
|
||||
|
||||
type Action string
|
||||
@@ -32,10 +31,15 @@ type Request struct {
|
||||
DestinationBundlePath string
|
||||
Publish config.PublishPolicy
|
||||
Transform config.Transform
|
||||
Transformers TransformerResolver
|
||||
Transfer config.TransferPolicy
|
||||
DistributorVersion string
|
||||
}
|
||||
|
||||
type TransformerResolver interface {
|
||||
Get(name string) (transform.Transformer, bool)
|
||||
}
|
||||
|
||||
type Plan struct {
|
||||
PipelineID string
|
||||
DestinationID string
|
||||
@@ -108,10 +112,6 @@ func validateRequest(req Request) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func markdownTransformer() transform.Transformer {
|
||||
return markdowntransform.New()
|
||||
}
|
||||
|
||||
func actionForComparison(comparison state.Comparison, transfer config.TransferPolicy) (Action, string) {
|
||||
switch comparison.Outcome {
|
||||
case state.OutcomeDestinationAbsent:
|
||||
|
||||
Reference in New Issue
Block a user