ResolveTaskModelAlias returns the mapping-derived alias target for name (exact or ASCII-folded). g is the caller's routing generation: a Number mismatch or TTL expiry rebuilds the view against that generation.
(g *jsplugin.RoutingGeneration, name string)
| 36 | // (exact or ASCII-folded). g is the caller's routing generation: a Number |
| 37 | // mismatch or TTL expiry rebuilds the view against that generation. |
| 38 | func ResolveTaskModelAlias(g *jsplugin.RoutingGeneration, name string) (TaskAliasTarget, bool) { |
| 39 | if g == nil || name == "" { |
| 40 | return TaskAliasTarget{}, false |
| 41 | } |
| 42 | view := loadFreshTaskAliasView(g) |
| 43 | if view == nil { |
| 44 | return TaskAliasTarget{}, false |
| 45 | } |
| 46 | target, ok := view.byFold[jsplugin.ASCIIFold(name)] |
| 47 | return target, ok |
| 48 | } |
| 49 | |
| 50 | func loadFreshTaskAliasView(g *jsplugin.RoutingGeneration) *taskAliasView { |
| 51 | view := taskAliasViewPtr.Load() |
no test coverage detected