maxHistory
untyped bigintmaxHistory is the number of recent changes kept in the log.
Value
(20 <untyped> bigint)
change
typechange is a single recorded mutation of the counter.
Value
v0.change
value
intvalue is the current shared counter.
Value
2
total
inttotal counts every mutation ever applied (not capped, unlike history).
Value
4
history
[]v0.changehistory holds the last maxHistory changes, oldest first.
- OID
- 04476f…3640:24
history details
record
func(delta int, newValue int)record appends a change to the history, trimming to the last maxHistory.
- OID
- 04476f…3640:6
record details
Inc
func() intInc adds one to the shared counter and logs the change.
- OID
- 04476f…3640:8
Inc details
Dec
func() intDec subtracts one from the shared counter and logs the change.
- OID
- 04476f…3640:9
Dec details
Reset
func() intReset sets the shared counter back to zero and logs the change. The recorded delta is the amount required to bring the previous value to zero.
- OID
- 04476f…3640:10
Reset details
Value
func() intValue returns the current counter value (read-only helper).
- OID
- 04476f…3640:11
Value details
Total
func() intTotal returns the total number of mutations ever applied.
- OID
- 04476f…3640:12
Total details
Render
func(path string) stringRender produces a Markdown view: the big current value, the total number of changes, and a table of the most recent changes (newest first).
- OID
- 04476f…3640:13
Render details
signed
func(n int) stringsigned formats an int with an explicit leading sign for non-negative values.
- OID
- 04476f…3640:14