mirror of
https://github.com/hanzoai/tasks.git
synced 2026-11-03 03:56:04 +00:00
## What changed? Support data only namespace updates and merges ## Why? optional customizations on this path ## How did you test it? - [ ] built - [ ] run locally and tested manually - [ ] covered by existing tests - [ ] added new unit test(s) - [ ] added new functional test(s) --------- Co-authored-by: Hanzo Dev <[email protected]>
22 lines
763 B
Go
22 lines
763 B
Go
package nsreplication
|
|
|
|
// NamespaceDataMerger provides custom merge logic for namespace data
|
|
// during replication task execution.
|
|
type NamespaceDataMerger interface {
|
|
// MergeData performs a business specific merge of namespace data.
|
|
MergeData(currentData, taskData map[string]string) (mergedData map[string]string, merged bool)
|
|
}
|
|
|
|
// NoopDataMerger is the default implementation that returns task data directly.
|
|
type NoopDataMerger struct{}
|
|
|
|
// NewNoopDataMerger creates a new NoopDataMerger.
|
|
func NewNoopDataMerger() NamespaceDataMerger {
|
|
return &NoopDataMerger{}
|
|
}
|
|
|
|
// MergeData returns taskData directly without any merging.
|
|
func (n *NoopDataMerger) MergeData(currentData, taskData map[string]string) (map[string]string, bool) {
|
|
return taskData, false
|
|
}
|