Documentation
¶
Overview ¶
Package handler implements the API gateway's HTTP endpoints. It proxies requests to the ingestion and search services via httputil.ReverseProxy and exposes direct PostgreSQL-backed endpoints for document listing, document retrieval, and API key management.
Index ¶
- type Config
- type Handler
- func (h *Handler) CreateAPIKey(w http.ResponseWriter, r *http.Request)
- func (h *Handler) GetDocument(w http.ResponseWriter, r *http.Request)
- func (h *Handler) Health(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListAPIKeys(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ListDocuments(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxyAnalytics(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxyCacheInvalidate(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxyCacheStats(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxyIngest(w http.ResponseWriter, r *http.Request)
- func (h *Handler) ProxySearch(w http.ResponseWriter, r *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler implements the API gateway's HTTP endpoints. It proxies requests to backend services and provides direct document retrieval and API key management via PostgreSQL.
func (*Handler) CreateAPIKey ¶
func (h *Handler) CreateAPIKey(w http.ResponseWriter, r *http.Request)
CreateAPIKey creates a new API key and returns the raw key (shown once).
func (*Handler) GetDocument ¶
func (h *Handler) GetDocument(w http.ResponseWriter, r *http.Request)
GetDocument retrieves a single document's metadata from PostgreSQL by UUID.
func (*Handler) Health ¶
func (h *Handler) Health(w http.ResponseWriter, r *http.Request)
Health returns the gateway's health status.
func (*Handler) ListAPIKeys ¶
func (h *Handler) ListAPIKeys(w http.ResponseWriter, r *http.Request)
ListAPIKeys returns all active API keys (without hashes).
func (*Handler) ListDocuments ¶
func (h *Handler) ListDocuments(w http.ResponseWriter, r *http.Request)
ListDocuments returns a paginated list of document metadata.
func (*Handler) ProxyAnalytics ¶
func (h *Handler) ProxyAnalytics(w http.ResponseWriter, r *http.Request)
ProxyAnalytics forwards analytics requests to the search service.
func (*Handler) ProxyCacheInvalidate ¶
func (h *Handler) ProxyCacheInvalidate(w http.ResponseWriter, r *http.Request)
ProxyCacheInvalidate forwards cache invalidation requests to the search service.
func (*Handler) ProxyCacheStats ¶
func (h *Handler) ProxyCacheStats(w http.ResponseWriter, r *http.Request)
ProxyCacheStats forwards cache stats requests to the search service.
func (*Handler) ProxyIngest ¶
func (h *Handler) ProxyIngest(w http.ResponseWriter, r *http.Request)
ProxyIngest forwards document ingestion requests to the ingestion service.
func (*Handler) ProxySearch ¶
func (h *Handler) ProxySearch(w http.ResponseWriter, r *http.Request)
ProxySearch forwards search queries to the search service.