counters

package
v0.0.0-...-6dc70a1 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChunkedCounter

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

ChunkedCounter ...

func NewChunkedCounter

func NewChunkedCounter(step uint64) ChunkedCounter

NewChunkedCounter ...

func (*ChunkedCounter) Increase

func (counter *ChunkedCounter) Increase() (previous uint64)

Increase ...

func (ChunkedCounter) IsOver

func (counter ChunkedCounter) IsOver() bool

IsOver ...

func (*ChunkedCounter) Reset

func (counter *ChunkedCounter) Reset(initial uint64)

Reset ...

type CounterGroup

type CounterGroup struct {
	DistributedCounters []DistributedCounter
	RandomSource        RandomSource
}

CounterGroup ...

func (CounterGroup) SelectCounter

func (group CounterGroup) SelectCounter() DistributedCounter

SelectCounter ...

type DistributedCounter

type DistributedCounter interface {
	NextCountChunk() (uint64, error)
}

DistributedCounter ...

type RandomSource

type RandomSource func(maximum int) int

RandomSource ...

type TransformedCounter

type TransformedCounter struct {
	DistributedCounter DistributedCounter
	Transformer        Transformer
}

TransformedCounter ...

func (TransformedCounter) NextCountChunk

func (counter TransformedCounter) NextCountChunk() (uint64, error)

NextCountChunk ...

type Transformer

type Transformer func(countChunk uint64) uint64

Transformer ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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