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

home state

Back to all declarations

admin

.uverse.address

admin is the only address allowed to write. Deliberately a constant and not transferable ownership: this realm is one person's profile page, and the same address is the only one the chain lets redeploy it.

Value

<gnolang.StringValue>

layoutSlug

untyped string

layoutSlug names the slot used as the page template.

Value

"layout"

maxSlugLen

untyped bigint

maxSlugLen bounds a slug so an index row stays readable and a key stays cheap.

Value

(64 <untyped> bigint)

rev

int

// total number of writes, bumped by every mutation

Value

8

slot

type

Value

home.slot

reservedSlugs

[]string (len=6)

reservedSlugs are placeholder names computed at render time from chain state. A slot may not take one, because it would shadow the computed value and make the page depend on callback registration order.

Open
OID
0517a5…9759:8
reservedSlugs details (len=6)

+6 more Inspect slice

validSlug

func(slug string) bool

validSlug reports whether slug is a legal slot name: 1..maxSlugLen bytes of \[a-z0-9.\_-]. The character set excludes ':' so a slug can never break out of its own :slug: placeholder, and excludes uppercase so a slot has one name.

Open
OID
0517a5…9759:11
validSlug details

Inspect func

assertWritableSlug

func(slug string)
Open
OID
0517a5…9759:12
assertWritableSlug details

Inspect func

Set

func(slug string, body string)

Set creates or replaces the slot named slug. This is the ordinary update: one slot, one transaction. Passing the empty body keeps the slot but empties it; use Delete to remove it.

Open
OID
0517a5…9759:13
Set details

Inspect func

Append

func(slug string, body string)

Append adds to the end of a slot, creating it when absent. It exists for content too large to fit in one transaction: Set the first chunk, Append the rest. Ordinary updates should use Set, which is idempotent.

Open
OID
0517a5…9759:14
Append details

Inspect func

Delete

func(slug string)

Delete removes a slot. Deleting the layout slot restores the built-in default layout.

Open
OID
0517a5…9759:15
Delete details

Inspect func

Get

func(slug string) string

Get returns a slot body, or "" when the slot does not exist.

Open
OID
0517a5…9759:16
Get details

Inspect func

Revision

func() int

Revision returns the total number of writes this realm has accepted. It changes on every mutation, so a client can cheaply tell "nothing moved".

Open
OID
0517a5…9759:17
Revision details

Inspect func

Manifest

func() string

Manifest returns one tab-separated line per slot: <slug>\t<rev>\t<len>\t<sha256 of body, hex> It is the diff surface tools/gnohome queries with vm/qeval: one read tells it exactly which local file is out of date, without downloading any body.

Open
OID
0517a5…9759:18
Manifest details

Inspect func

defaultLayout

untyped string

defaultLayout is what renders before a layout slot exists, i.e. right after the very first deploy. It uses only computed placeholders, so it never shows an unresolved :slug: of its own.

Value

"# gno.land/r/moul/home\n\nNo layout slot yet. Set one, then the page is whatever you make it:\n\n gnokey maketx call -pkgpath gno.land/r/moul/home -func Set \\\n -args layout -args \"$(/bin/cat content/layout.md)\" \\\n -gas-fee 1000000ugnot -gas-wanted"...

Render

func(path string) string

Render serves three views: "" the assembled page, what https://gno.land/u/moul shows "slots" the slot index: name, size, revision, last write "slots/<slug>" one slot's raw markdown, fenced

Open
OID
0517a5…9759:21
Render details

Inspect func

renderPage

func() string

renderPage fills the layout. dynreplacer only invokes the callbacks whose placeholder actually occurs in the layout, so an unused slot is never even read out of the tree.

Open
OID
0517a5…9759:22
renderPage details

Inspect func

renderSlot

func(slug string) string
Open
OID
0517a5…9759:25
renderSlot details

Inspect func
admin : .uverse.address =<gnolang.StringValue>
layoutSlug : untyped string ="layout"
maxSlugLen : untyped bigint =(64 <untyped> bigint)
slots : *v0.Tree Inspect
rev : int =8
slot : type =home.slot
reservedSlugs : []string (len=6) Inspect
assertAdmin : func() Inspect
validSlug : func(slug string) bool Inspect
assertWritableSlug : func(slug string) Inspect
Set : func(slug string, body string) Inspect
Append : func(slug string, body string) Inspect
Delete : func(slug string) Inspect
Get : func(slug string) string Inspect
Revision : func() int Inspect
Manifest : func() string Inspect
defaultLayout : untyped string ="# gno.land/r/moul/home\n\nNo layout slot yet. Set one, then the page is whatever you make it:\n\n gnokey maketx call -pkgpath gno.land/r/moul/home -func Set \\\n -args layout -args \"$(/bin/cat content/layout.md)\" \\\n -gas-fee 1000000ugnot -gas-wanted"...
chainHeight : func() int64 Inspect
Render : func(path string) string Inspect
renderPage : func() string Inspect
renderIndex : func() string Inspect
renderSlot : func(slug string) string Inspect