DevPanel Examples
The official runnable project is ss-keel-examples/examples/15-devpanel.
Mount the panel
Section titled “Mount the panel”panel := devpanel.New(panelCfg)panelLog := panel.Logger()
fiberApp := app.Fiber()fiberApp.Use(panel.RequestMiddleware())fiberApp.Use(panel.GlobalGuard())panel.Mount(fiberApp)defer panel.Shutdown()Emit logs into the panel
Section titled “Emit logs into the panel”panelLog.Info("listed %d events", len(snapshot))panelLog.Info("created event id=%s title=%q", ev.ID, ev.Title)Generate visible request traffic
Section titled “Generate visible request traffic”httpx.GET("/api/events", func(c *httpx.Ctx) error { eventsMu.RLock() snapshot := make([]Event, len(events)) copy(snapshot, events) eventsMu.RUnlock()
panelLog.Info("listed %d events", len(snapshot)) return c.OK(snapshot)})