Versions in this module Expand all Collapse all v0 v0.2.0 Mar 7, 2026 v0.1.1 Mar 4, 2026 Changes in this version + func CleanReferrer(ref string) string + func ExtractBotName(ua string) string + func GenerateVisitorID(ip, userAgent string) string + func HashIP(ip string) string + func InitSalt(store *Store) error + func IsBot(ua string) bool + func ParseUserAgent(ua string) (browser, os, device string) + func TruncateDate(t time.Time, period string) time.Time + type BotStats struct + DailyVisits []DailyView + Period string + TopBots []DimensionStat + TopPages []PageStat + TotalVisits int + type BotStatsResponse struct + Hourly bool + Monthly bool + PeriodDays int + Stats *BotStats + type BotVisit struct + BotName string + ID int64 + IPHash string + Path string + Timestamp time.Time + UserAgent string + type CollectRequest struct + DurationSec int + Path string + Referrer string + ScreenSize string + UserAgent string + type DailyView struct + Date string + Views int + type DimensionStat struct + Count int + Name string + type Handler struct + func NewHandler(store *Store) *Handler + func (h *Handler) Collect(c echo.Context) error + func (h *Handler) Dashboard(c echo.Context) error + func (h *Handler) DashboardHTML(c echo.Context) error + func (h *Handler) GetBotStats(c echo.Context) error + func (h *Handler) GetBotStatsFragment(c echo.Context) error + func (h *Handler) GetSetupFragment(c echo.Context) error + func (h *Handler) GetStats(c echo.Context) error + func (h *Handler) GetStatsFragment(c echo.Context) error + func (h *Handler) RegisterRoutes(e *echo.Echo, publicGroup *echo.Group, authMiddleware echo.MiddlewareFunc) + type LatestPageVisit struct + Browser string + Path string + Timestamp string + type PageStat struct + Path string + Views int + type Stats struct + AvgDuration int + BrowserStats []DimensionStat + DailyViews []DailyView + DeviceStats []DimensionStat + LatestPages []LatestPageVisit + OSStats []DimensionStat + Period string + ReferrerStats []DimensionStat + TopPages []PageStat + TotalViews int + UniqueVisitors int + type StatsResponse struct + Hourly bool + Monthly bool + PeriodDays int + Realtime int + Stats *Stats + type Store struct + func NewStore(dbPath string) (*Store, error) + func (s *Store) CleanupOldVisits(retentionDays int) error + func (s *Store) Close() error + func (s *Store) GetBotStats(from, to time.Time, hourly, monthly bool) (*BotStats, error) + func (s *Store) GetRealtimeVisitors() (int, error) + func (s *Store) GetSetting(key string) (string, error) + func (s *Store) GetStats(from, to time.Time, hourly, monthly bool) (*Stats, error) + func (s *Store) SaveBotVisit(bv *BotVisit) error + func (s *Store) SaveVisit(v *Visit) error + func (s *Store) SetSetting(key, value string) error + func (s *Store) StartCleanupScheduler(retentionDays int, interval time.Duration) func() + func (s *Store) UpdateVisitDuration(visitorID, path string, durationSec int) error + type Visit struct + Browser string + Device string + DurationSec int + ID int64 + IPHash string + OS string + Path string + Referrer string + ScreenSize string + SessionID string + Timestamp time.Time + VisitorID string + type VisitRequest struct + Language string + Path string + Referrer string + ScreenSize string + UserAgent string v0.1.0 Mar 3, 2026