(name string)
| 697 | } |
| 698 | |
| 699 | func (m *Manager) snapshotFunction(name string) (functionSnapshot, bool) { |
| 700 | m.mux.Lock() |
| 701 | fs, ok := m.functionRegistry[name] |
| 702 | snap := functionSnapshot{} |
| 703 | if ok && fs != nil { |
| 704 | snap.direct = fs.direct |
| 705 | if len(fs.prefixes) > 0 { |
| 706 | snap.prefixes = make(map[string]func(Function), len(fs.prefixes)) |
| 707 | maps.Copy(snap.prefixes, fs.prefixes) |
| 708 | } |
| 709 | } |
| 710 | m.mux.Unlock() |
| 711 | |
| 712 | if !ok || fs == nil { |
| 713 | return functionSnapshot{}, false |
| 714 | } |
| 715 | return snap, true |
| 716 | } |
| 717 | |
| 718 | func matchPrefix(prefixes map[string]func(Function), id string) (string, func(Function), bool) { |
| 719 | if len(prefixes) == 0 || id == "" { |
no test coverage detected