GetByHost returns the entry for the given host (exact match, case-insensitive), or nil if not found.
(host string)
| 153 | |
| 154 | // GetByHost returns the entry for the given host (exact match, case-insensitive), or nil if not found. |
| 155 | func (r *Registry) GetByHost(host string) *Entry { |
| 156 | if r == nil { |
| 157 | return nil |
| 158 | } |
| 159 | key := strings.ToLower(strings.TrimSpace(host)) |
| 160 | if key == "" { |
| 161 | return nil |
| 162 | } |
| 163 | r.mu.RLock() |
| 164 | defer r.mu.RUnlock() |
| 165 | return r.byHost[key] |
| 166 | } |
| 167 | |
| 168 | // ListHosts returns all active hosts. Used by automation jobs to process all hosts. |
| 169 | func (r *Registry) ListHosts() []string { |
no outgoing calls
no test coverage detected