Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Factor ¶
Factor indicates which value should be returned after a streak lasted the given duration
type Streaker ¶
type Streaker struct { MaxDelayBetweenHits time.Duration Factors []Factor // contains filtered or unexported fields }
Streaker contains the streaker parameters Factors must be sorted
func New ¶
New creates a new Streaker A streaker returns a given Factor.Value after the Factor.Delay has passed (since the start of the streak) The value is reset to 1 when two hits are more than maxDelayBetweenHits apart. The factors will be automatically sorted.
func (*Streaker) UpdatedFactor ¶
UpdatedFactor returns the factor after considering a hit
Click to show internal directories.
Click to hide internal directories.