Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type MemStore ¶
type MemStore struct {
// contains filtered or unexported fields
}
MemStore maintains a list of counter, when an interval passes, it rotates. The oldest (pointed by current) will be cleared and start a new counting process.
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
func NewRedisStore ¶
type TimedCounter ¶
type TimedCounter struct {
// contains filtered or unexported fields
}
TimedCounter every interval passes, try to store and reset the counter.
func NewCounterWithStore ¶
func NewCounterWithStore(interval time.Duration, store Store) *TimedCounter
func (*TimedCounter) Inc ¶
func (tc *TimedCounter) Inc(key string)
func (*TimedCounter) Report ¶
func (tc *TimedCounter) Report() (result []Element, err error)
func (*TimedCounter) Stop ¶
func (tc *TimedCounter) Stop()
Click to show internal directories.
Click to hide internal directories.