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

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v0 state

Back to all declarations

limiter

*v0.Limiter

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

Open
OID
05ee82…3da9: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
05ee82…3da9: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
05ee82…3da9: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
05ee82…3da9: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
05ee82…3da9: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