Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 state

Back to all declarations

limiter

*v0.Limiter

limiter starts at 0.5 tokens/block (one every two blocks), capacity 5.

Open
OID
092a19…c164:4
limiter details

Inspect pointer

Allow

func() bool

Allow consumes one token for the calling realm/user at the current block height and reports whether the request is permitted. Returns false (and consumes nothing) when the caller's bucket is empty.

Open
OID
092a19…c164:8
Allow details

Inspect func

SetConfig

func(rate float64, burst float64)

SetConfig updates the shared rate (tokens per block) and burst (capacity). rate is clamped to >= 0, burst to >= 1.

Open
OID
092a19…c164:10
SetConfig details

Inspect func

Tokens

func(addr .uverse.address) int

Tokens reports how many whole tokens \`addr\` has available at the current block height, without mutating any state.

Open
OID
092a19…c164:11
Tokens details

Inspect func

Render

func(path string) string

Render shows the limiter config and a table of known callers with their current tokens and last-seen height. Path "/addr/\<address>" focuses one caller.

Open
OID
092a19…c164:13
Render details

Inspect func
limiter : *v0.Limiter Inspect
Allow : func() bool Inspect
SetConfig : func(rate float64, burst float64) Inspect
Tokens : func(addr .uverse.address) int Inspect
ftoa : func(f float64) string Inspect
Render : func(path string) string Inspect