Documentation
¶
Overview ¶
Package visitors counts unique daily visitors and persists the running total in the settings table, shared across instances.
Index ¶
Constants ¶
View Source
const ( // OptOutCookie, when present, stops this browser being counted. The // privacy page sets it; counting relies on PECR's statistics exemption, // which requires a simple way to object. OptOutCookie = "afc_no_visit_count" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter records visits locally and flushes them to the database.
func (*Counter) Flush ¶
Flush adds pending visits to the database total, or, with nothing pending, re-reads the total so this instance sees other instances' visits.
func (*Counter) Middleware ¶
func (c *Counter) Middleware(next echo.HandlerFunc) echo.HandlerFunc
Middleware counts a visit the first time a browser is seen in 24 hours, unless it has opted out.
Click to show internal directories.
Click to hide internal directories.