Documentation ¶
Index ¶
- Constants
- func AllHosts(db *sqlx.DB) (hosts []string, err error)
- func AllPaths(db *sqlx.DB) (paths []string, err error)
- func ListDistinctColumn(db *sqlx.DB, col string) (entries []string, err error)
- func ViewsForHostPath(db *sqlx.DB, host string, path string) (count int, err error)
- func VisitorsForHostPath(db *sqlx.DB, host string, path string) (count int, err error)
Constants ¶
View Source
const ( // Count the number of distinct IP addresses which have visited the host & path. QueryVisitorsPerHostPath = `SELECT COUNT(distinct ip) FROM visits WHERE host = ? AND path = ?;` // Count the number of entries with the given host & path. QueryVisitsPerHostPath = `SELECT COUNT(id) FROM visits WHERE host = ? AND path = ?;` // List all the distinct paths in the database. QueryAllPaths = `SELECT DISTINCT path FROM visits;` // List all the distinct hosts in the database. QueryAllHosts = `SELECT DISTINCT host FROM visits;` )
Variables ¶
This section is empty.
Functions ¶
func ListDistinctColumn ¶
Fetch the distinct entries of an arbitrary column in the database.
func ViewsForHostPath ¶
Fetch a count of all the views of the path.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.