handlers

package
v1.50.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 30, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnalyticsHandler added in v1.35.0

type AnalyticsHandler struct {
	// contains filtered or unexported fields
}

AnalyticsHandler handles POST /api/analytics and GET /api/analytics/summary.

func NewAnalyticsHandler added in v1.35.0

func NewAnalyticsHandler(provider analytics.AnalyticsProvider) *AnalyticsHandler

NewAnalyticsHandler creates a new AnalyticsHandler with a 1000/min rate limiter.

func NewAnalyticsHandlerWithClient added in v1.35.0

func NewAnalyticsHandlerWithClient(provider analytics.AnalyticsProvider, client *ent.Client) *AnalyticsHandler

NewAnalyticsHandlerWithClient creates a new AnalyticsHandler that can also serve summary queries from the ent client. Use this in production wiring.

func (*AnalyticsHandler) HandlePost added in v1.35.0

func (h *AnalyticsHandler) HandlePost(w http.ResponseWriter, r *http.Request)

HandlePost handles POST /api/analytics.

func (*AnalyticsHandler) HandleSummary added in v1.35.0

func (h *AnalyticsHandler) HandleSummary(w http.ResponseWriter, r *http.Request)

HandleSummary handles GET /api/analytics/summary.

func (*AnalyticsHandler) RegisterRoutes added in v1.35.0

func (h *AnalyticsHandler) RegisterRoutes(mux *http.ServeMux)

RegisterRoutes registers the analytics routes on mux.

type TelemetryHandler

type TelemetryHandler struct {
	// contains filtered or unexported fields
}

TelemetryHandler handles frontend performance telemetry events.

func NewTelemetryHandler

func NewTelemetryHandler(provider analytics.AnalyticsProvider) *TelemetryHandler

NewTelemetryHandler creates a new TelemetryHandler. The provider receives a forwarded analytics.Event for each valid telemetry request. Pass analytics.NewLogAnalyticsProvider() in tests or when no DB is available.

func (*TelemetryHandler) HandleTelemetry

func (h *TelemetryHandler) HandleTelemetry(w http.ResponseWriter, r *http.Request)

HandleTelemetry handles POST /api/telemetry.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL