Files
Havline/internal/api/discovery_handler.go
T

21 lines
424 B
Go
Raw Normal View History

2026-09-23 09:40:59 +08:00
package api
import (
"net/http"
2026-10-01 16:54:35 +08:00
"github.com/havline/havline/internal/discovery"
2026-09-23 09:40:59 +08:00
)
type DiscoveryHandler struct {
svc *discovery.Service
}
func NewDiscoveryHandler(svc *discovery.Service) *DiscoveryHandler {
return &DiscoveryHandler{svc: svc}
}
func (h *DiscoveryHandler) Scan(w http.ResponseWriter, r *http.Request) {
host := r.URL.Query().Get("host")
writeJSON(w, http.StatusOK, h.svc.Scan(r.Context(), host))
}