analytics

package
v0.0.0-...-2968fc5 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Count the number of distinct IP addresses which have visitied the path.
	QueryVisitorsPerPath = `SELECT COUNT(distinct ip) FROM visits WHERE path = ?;`
	// Count the number of entries with the given path.
	QueryVisitsPerPath = `SELECT COUNT(id) FROM visits WHERE 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 AllHosts

func AllHosts(db *sqlx.DB) (hosts []string, err error)

Fetch all the hosts in the database.

func AllPaths

func AllPaths(db *sqlx.DB) (paths []string, err error)

Fetch all the paths in the database.

func ListDistinctColumn

func ListDistinctColumn(db *sqlx.DB, col string) (entries []string, err error)

Fetch the distinct entries of an arbitrary column in the database.

func ViewsForPath

func ViewsForPath(db *sqlx.DB, path string) (count int, err error)

Fetch a count of all the views of the path.

func VisitorsForPath

func VisitorsForPath(db *sqlx.DB, path string) (count int, err error)

Fetch a count of all the visitors for the given path. This is done by counting the distinct IP addresses which have visited the path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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