| title | Validator / Fixer / Updater Pipeline | ||||||
|---|---|---|---|---|---|---|---|
| category | patterns | ||||||
| tags |
|
||||||
| confidence | high | ||||||
| source | internal/processor/, internal/service/service.go | ||||||
| updated | 2026-07-22 |
The repo's asset-quality enforcement uses three parallel strategy patterns, each represented as a named function value.
// internal/processor/model.go
type Validator struct { Name string; Run func(f *file.AssetFile) error }
type Fixer struct { Name string; Run func(f *file.AssetFile) error }
type Updater struct { Name string; Run func() error }processor.Service.GetValidator(f)/GetFixers(f)— returns the slice ofValidator/Fixerapplicable to the givenAssetFile(determined byf.Type()).service.Service.RunJob(job)— iterates all asset file paths, callsjob(f)(eitherCheckorFix), and tracks errors viareport.Service.Checkruns all validators;Fixruns all fixers;RunUpdateAutoruns all auto-updaters without iterating files.
processor.Service.GetValidator(f) and GetFixers(f) dispatch based on file.AssetFile.Type() — different asset types (root folder, chain folder, asset folder, tokenlist, etc.) get different validator sets.
There is one layer violation recorded: InitAssetsService (service layer) calls filter (labeled controller by the tool). filter is a generic Go 1.18 type-parameter helper in internal/manager/manager.go — it filters the file-path slice before building the service. The "controller" label is a mis-classification by the tool; filter is a utility function, not a controller boundary. Safe to ignore.