logs

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2017 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddQuery

func AddQuery(clientip, domain string, cached int, timestamp int64) error

func AddQueryToGraphite

func AddQueryToGraphite(isBlocked, isIpv4, isCached bool)

func Flush

func Flush() error

func GetInstance

func GetInstance() *sql.DB

func SetupDB

func SetupDB()

func StartStatsLoop

func StartStatsLoop()

Types

type ClientLog

type ClientLog struct {
	ClientIp string
	Queries  int
}

func GetClients

func GetClients() ([]ClientLog, error)

type DomainLog

type DomainLog struct {
	Domain  string
	Queries int
}

func GetTopDomains

func GetTopDomains(limit string) ([]DomainLog, error)

type QueryLog

type QueryLog struct {
	Id        int
	ClientIp  string
	Domain    string
	Cached    int
	Timestamp int64
}

func GetQueriesByClientIp

func GetQueriesByClientIp(clientIp, limit string) ([]QueryLog, error)

func GetQueriesByDomain

func GetQueriesByDomain(domain string) ([]QueryLog, error)

type Statistics

type Statistics struct {
	Total      int
	Blocked    int
	NonBlocked int
	Cached     int
	NonCached  int
	Ipv4       int
	Ipv6       int
}

Jump to

Keyboard shortcuts

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