package registry import "os" // ArtifactHosts discovers candidates; it supplies no installation authority. // Include orphan and inactive timers. Due-time filtering would hide obligations. func (r *Registry) ArtifactHosts() ([]string, error) { if r.remote != nil { out, err := r.remote.call(nil, remoteRequest{Method: "ArtifactHosts"}, nil) return out.Hosts, err } rows, err := r.sql.Query(`SELECT host FROM routes UNION SELECT host FROM timers ORDER BY host LIMIT 8193`) if err != nil { return nil, err } defer rows.Close() var hosts []string for rows.Next() { var host string if err := rows.Scan(&host); err != nil { return nil, err } if len(hosts) == 8192 { return nil, os.ErrPermission } hosts = append(hosts, host) } if err := rows.Err(); err != nil { return nil, err } return hosts, nil }