topdb

package
v0.0.0-...-c13d752 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TopContent    = "content"
	TopPageview   = "pv"
	TopReferer    = "referer"
	TopStatusCode = "status"
	TopCountry    = "country"
	TopHost       = "host"
	TopStatus     = "status"
	TopDuration   = "duration"
	TopPathStatus = "pathstatus"
)
View Source
var (
	App = "app"
)
View Source
var Intervals = []Interval{All, Day, Month, Year}

Functions

This section is empty.

Types

type Interval

type Interval int
const (
	All Interval = iota
	Year
	Month
	Day
)

type TopDB

type TopDB struct {
	// contains filtered or unexported fields
}

func New

func New(path string) (*TopDB, error)

func (*TopDB) Close

func (db *TopDB) Close() error

func (*TopDB) Get

func (db *TopDB) Get(i Interval, t time.Time, top, key string) (uint64, error)

func (*TopDB) GetTops

func (db *TopDB) GetTops(i Interval, t time.Time, top string) ([]*TopEntry, error)

func (*TopDB) Incr

func (db *TopDB) Incr(i Interval, t time.Time, top, key string, value uint64) error

func (*TopDB) IncrAll

func (db *TopDB) IncrAll(t time.Time, top, key string, value uint64) error

type TopEntry

type TopEntry struct {
	Key   string
	Value uint64
}

Jump to

Keyboard shortcuts

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