counter

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CounterEvent

type CounterEvent struct {
	Prefix string
	Key    string
	Delta  float64
}

type CounterWorker

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

func NewCounterWorker

func NewCounterWorker(redis redis.UniversalClient, flushEvery time.Duration, threshold float64, bufferSize int) *CounterWorker

func (*CounterWorker) FlushNow

func (cw *CounterWorker) FlushNow(prefix string, ctx context.Context) error

func (*CounterWorker) GetInterval

func (cw *CounterWorker) GetInterval() time.Duration

func (*CounterWorker) Increment

func (cw *CounterWorker) Increment(prefix, key string, delta float64)

func (*CounterWorker) Start

func (cw *CounterWorker) Start(ctx context.Context)

func (*CounterWorker) Stop

func (cw *CounterWorker) Stop()

Jump to

Keyboard shortcuts

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