hits

package
v0.0.0-...-4106b0c Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hits

type Hits struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Hits store information about API hits

func NewHits

func NewHits() *Hits

NewHits return new hits

func NewHitsRedis

func NewHitsRedis(url string) *Hits

NewHitsRedis return Hits that uses Redis as storage backend

func (*Hits) CloseRedis

func (h *Hits) CloseRedis() error

CloseRedis closes connection to redis

func (*Hits) Incr

func (h *Hits) Incr(key string)

Incr increments by key

func (*Hits) Stats

func (h *Hits) Stats() (map[string]int, error)

Stats show stats

Jump to

Keyboard shortcuts

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