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

Use

type

Use records one exercise of a capability.

Value

v0.Use

Capability

type

Capability is a least-privilege grant from a granter to a principal.

Value

v0.Capability

caps

[]*v0.Capability

// index 0 => ID 1

Value

<zero>

Grant

func(principal .uverse.address, targetRealm string, function string, maxCoins int64, validUntil int64, uses uint32, argsPolicy string) uint64

Grant issues a capability. The caller becomes its granter and can revoke it later. validUntil is an absolute block height (0 = no expiry).

Open
OID
092de8…4b8e:4
Grant details

Inspect func

Exercise

func(id uint64, coins int64)

Exercise consumes one use of a capability. Only the principal may call it, and every bound is checked: not revoked, not expired, uses remaining, and coins within the ceiling. On success the use is recorded and the counter decremented.

Open
OID
092de8…4b8e:6
Exercise details

Inspect func

Revoke

func(id uint64)

Revoke disables a capability immediately. Only the granter may revoke.

Open
OID
092de8…4b8e:7
Revoke details

Inspect func

Authorized

func(id uint64, principal .uverse.address, coins int64) bool

Authorized reports whether principal may exercise capability id for the given coin amount right now — the check a target realm runs before acting. It never mutates state or consumes a use.

Open
OID
092de8…4b8e:8
Authorized details

Inspect func

Get

func(id uint64) v0.Capability

Get returns a copy of a capability.

Open
OID
092de8…4b8e:9
Get details

Inspect func

Count

func() int

Count returns the number of capabilities issued.

Open
OID
092de8…4b8e:10
Count details

Inspect func

usable

func(c *v0.Capability) bool
Open
OID
092de8…4b8e:11
usable details

Inspect func

assertUsable

func(c *v0.Capability)
Open
OID
092de8…4b8e:12
assertUsable details

Inspect func

mustGet

func(id uint64) *v0.Capability
Open
OID
092de8…4b8e:13
mustGet details

Inspect func

assert

func(cond bool, msg string)
Open
OID
092de8…4b8e:14
assert details

Inspect func

Render

func(path string) string

Render shows all capabilities, or one capability's detail + usage at :\<id>.

Open
OID
092de8…4b8e:15
Render details

Inspect func

renderCap

func(id uint64) string
Open
OID
092de8…4b8e:17
renderCap details

Inspect func

state

func(c *v0.Capability) string
Open
OID
092de8…4b8e:18
state details

Inspect func

short

func(a .uverse.address) string
Open
OID
092de8…4b8e:20
short details

Inspect func
Use : type =v0.Use
Capability : type =v0.Capability
caps : []*v0.Capability =<zero>
Grant : func(principal .uverse.address, targetRealm string, function string, maxCoins int64, validUntil int64, uses uint32, argsPolicy string) uint64 Inspect
Exercise : func(id uint64, coins int64) Inspect
Revoke : func(id uint64) Inspect
Authorized : func(id uint64, principal .uverse.address, coins int64) bool Inspect
Get : func(id uint64) v0.Capability Inspect
Count : func() int Inspect
usable : func(c *v0.Capability) bool Inspect
assertUsable : func(c *v0.Capability) Inspect
mustGet : func(id uint64) *v0.Capability Inspect
assert : func(cond bool, msg string) Inspect
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderCap : func(id uint64) string Inspect
state : func(c *v0.Capability) string Inspect
parseID : func(s string) uint64 Inspect
short : func(a .uverse.address) string Inspect