Documentation
¶
Index ¶
Constants ¶
View Source
const ( WindowSize = 10 WindowSliceSize = WindowSize * consts.Uint64Len )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Window ¶
type Window [WindowSliceSize]byte
func Roll ¶
Roll rolls the uint64s within [consumptionWindow] over by [roll] places. For example, if there are 4 uint64 encoded in a 32 byte slice, rollWindow would have the following effect: Original: [1, 2, 3, 4] Roll = 0 [1, 2, 3, 4] Roll = 1 [2, 3, 4, 0] Roll = 2 [3, 4, 0, 0] Roll = 3 [4, 0, 0, 0] Roll >= 4 [0, 0, 0, 0] Assumes that [roll] is greater than or equal to 0
Click to show internal directories.
Click to hide internal directories.