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 initial authority: the only address that may write slots and accept, roll back or freeze a theme. It is a constant so a reviewer can read who controls the page without decoding chain state; TransferAuthority moves it afterwards. The value here is the standard test1 account, so the gnodev walkthrough in the README works unedited. \`make build ADMIN=g1...\` rewrites it for a real deployment.

Value

<gnolang.StringValue>

LayoutSlug

untyped string

Value

"layout"

StylePrefix

untyped string

Value

"style."

maxSlugLen

untyped bigint

Value

(64 <untyped> bigint)

Theme

type

Theme is what a renderer realm promises. It is declared here, in the file that can never change, so every theme version agrees on one type identity. Render receives the render path ("" is the profile page) and returns markdown. The operator views (system, slots, edit, manifest) never reach a theme; for any other path it does not draw itself, a theme should return Fallback(path). A panic here aborts the query: there is no recovering a foreign realm's panic, so a broken theme shows an error until Rollback.

Value

home.Theme

Slot

type

Slot is one named fragment of the page.

Value

home.Slot

selfPath

string

Value

"gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/home"

rev

int

// total writes accepted; bumps on every mutation

Value

17

lastHeight

int64

// height of the most recent write

Value

241605

assertAuthority

func()

assertAuthority panics unless the caller of the crossing function that owns cur is the current authority. It asks the proxy's Authority directly rather than going through proxy.AssertAuthorized, so content writes keep working after Freeze: freezing ends code upgrades, not editing.

Open
OID
0f08db…abe6:12
assertAuthority details

Inspect func

reservedSlugs

[]string (len=8)

reservedSlugs are placeholders computed at render time (see render.gno). A slot may not take one of these names, so the page never depends on which of the two would win.

Open
OID
0f08db…abe6:14
reservedSlugs details (len=8)

+8 more Inspect slice

validSlug

func(slug string) bool

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

Open
OID
0f08db…abe6:15
validSlug details

Inspect func

assertWritableSlug

func(slug string)
Open
OID
0f08db…abe6:16
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. An empty body keeps the slot but empties it; use Delete to remove it.

Open
OID
0f08db…abe6:17
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 a body too large for one transaction: Set the first chunk, Append the rest.

Open
OID
0f08db…abe6:18
Append details

Inspect func

Delete

func(slug string)

Delete removes a slot. Deleting the layout slot restores the theme's default layout.

Open
OID
0f08db…abe6:19
Delete details

Inspect func

write

func(slug string, body string)
Open
OID
0f08db…abe6:20
write details

Inspect func

Get

func(slug string) string

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

Open
OID
0f08db…abe6:22
Get details

Inspect func

Has

func(slug string) bool

Has reports whether a slot exists, empty or not.

Open
OID
0f08db…abe6:23
Has details

Inspect func

Lookup

func(slug string) (home.Slot, bool)

Lookup returns a copy of a slot and whether it exists.

Open
OID
0f08db…abe6:24
Lookup details

Inspect func

Slugs

func() []string

Slugs returns every slot name, sorted.

Open
OID
0f08db…abe6:25
Slugs details

Inspect func

Each

func(fn func(...))

Each visits every slot in name order until fn returns true.

Open
OID
0f08db…abe6:26
Each details

Inspect func

Style

func(key string, fallback string) string

Style returns the style knob named key (the slot "style."+key), or fallback when it is absent or empty.

Open
OID
0f08db…abe6:27
Style details

Inspect func

Layout

func() string

Layout returns the layout slot, or "" when none has been set. Themes substitute their own default in that case.

Open
OID
0f08db…abe6:28
Layout 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
0f08db…abe6:29
Revision details

Inspect func

LastHeight

func() int64

LastHeight returns the block height of the most recent write, or 0.

Open
OID
0f08db…abe6:30
LastHeight details

Inspect func

Manifest

func() string

Manifest returns one tab-separated line per slot: <slug>\t<rev>\t<bytes>\t<sha256 of body, hex> It is the diff surface scripts/sync.sh reads: one query tells it exactly which local file is out of date, without downloading any body.

Open
OID
0f08db…abe6:31
Manifest details

Inspect func

Path

func() string

Path returns this realm's package path, e.g. "gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/home".

Open
OID
0f08db…abe6:32
Path details

Inspect func

Register

func(t home.Theme)

Register records the calling realm's theme as a candidate. The path filed is read off the crossing frame, never taken as an argument, so a candidate cannot claim to live somewhere it does not. Only realms nested under this one are admitted; a direct user call is refused.

Open
OID
0f08db…abe6:34
Register details

Inspect func

Accept

func(pkgPath string)

Accept makes the candidate at pkgPath the live theme. Authority only.

Open
OID
0f08db…abe6:35
Accept details

Inspect func

Withdraw

func(pkgPath string)

Withdraw drops a candidate. Authority only, except that a theme realm may always drop its own.

Open
OID
0f08db…abe6:36
Withdraw details

Inspect func

Rollback

func()

Rollback restores the previous theme and returns the current one to the pending set. Authority only.

Open
OID
0f08db…abe6:37
Rollback details

Inspect func

Forget

func()

Forget drops the rollback history and the storage it holds. Authority only.

Open
OID
0f08db…abe6:38
Forget details

Inspect func

Freeze

func()

Freeze ends theme upgrades permanently. Slots stay editable. Authority only, and there is no way back.

Open
OID
0f08db…abe6:39
Freeze details

Inspect func

TransferAuthority

func(to .uverse.address)

TransferAuthority hands both editing and upgrading to another address.

Open
OID
0f08db…abe6:40
TransferAuthority details

Inspect func

LivePath

func() string

LivePath returns the realm path of the theme currently serving, or "".

Open
OID
0f08db…abe6:41
LivePath details

Inspect func

PendingPaths

func() []string

PendingPaths returns the candidate theme paths awaiting acceptance.

Open
OID
0f08db…abe6:42
PendingPaths details

Inspect func

HistoryPaths

func() []string

HistoryPaths returns the themes this realm has already served, oldest first, excluding the live one.

Open
OID
0f08db…abe6:43
HistoryPaths details

Inspect func

Frozen

func() bool

Frozen reports whether theme upgrades have ended.

Open
OID
0f08db…abe6:44
Frozen details

Inspect func

Authority

func() string

Authority returns a human-readable description of who may write and upgrade.

Open
OID
0f08db…abe6:45
Authority details

Inspect func

liveTheme

func() (home.Theme, bool)

liveTheme returns the accepted theme, if any.

Open
OID
0f08db…abe6:46
liveTheme details

Inspect func

Render

func(path string) string

Render is what gnoweb calls. The operator views (system, slots, edit, manifest) are always served here, never through the theme: a panic inside a foreign realm's code aborts the whole call and cannot be recovered from this side, so a theme that panics takes the page down until it is rolled back. These views are what the rollback is done from, and the routing keeps them out of the theme's reach. Every other path, the page itself included, goes to the live theme, or to the built-in renderer when none is accepted.

Open
OID
0f08db…abe6:47
Render details

Inspect func

operatorPaths

[]string (len=4)

operatorPaths are the render paths this realm keeps for itself.

Open
OID
0f08db…abe6:50
operatorPaths details (len=4)

+4 more Inspect slice

isOperatorPath

func(path string) bool
Open
OID
0f08db…abe6:51
isOperatorPath details

Inspect func

cleanPath

func(path string) string

cleanPath drops a query string from a render path.

Open
OID
0f08db…abe6:52
cleanPath details

Inspect func

Fallback

func(path string) string

Fallback is the built-in renderer. Render routes the operator views here directly, and themes delegate to it for every other path they do not draw themselves, so these views exist under any theme: "" the assembled page: the layout slot filled from the slots "slots" the slot index: name, size, revision, height of last write "slots/<slug>" one slot's raw markdown, fenced "edit" forms that write slots (they build the gnokey command) "edit/<slug>" the same, prefilled with one slot "system" who may write, which theme is live, pending, history "manifest" Manifest() as plain text, for scripts

Open
OID
0f08db…abe6:53
Fallback details

Inspect func

Filler

type

Filler substitutes :name: placeholders in a layout. It is lazy: a callback runs only when its placeholder occurs in the layout, so an unused slot is never even read. Substitution is single-pass and non-recursive, so a placeholder inside a slot body is left alone and no slot can expand into another. Names never contain ':', so no placeholder is a prefix of another and the result does not depend on registration order. A placeholder that nothing claims survives into the output verbatim: a missing section should be visible, not silently blank.

Value

home.Filler

NewFiller

func() *home.Filler

NewFiller returns a Filler with every slot and every computed placeholder registered. A theme adds its own widgets with Add before calling Fill.

Open
OID
0f08db…abe6:54
NewFiller details

Inspect func

updated

func() string

updated is the :updated: placeholder: when the slots last changed.

Open
OID
0f08db…abe6:55
updated details

Inspect func

defaultLayout

func() string

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

Open
OID
0f08db…abe6:56
defaultLayout details

Inspect func

renderSlot

func(slug string) string
Open
OID
0f08db…abe6:60
renderSlot details

Inspect func

fence

func(body string) string

fence returns a code fence longer than any backtick run in body, so the body can never close it early.

Open
OID
0f08db…abe6:61
fence details

Inspect func

renderEdit

func(slug string) string

renderEdit is the in-browser editor: gnoweb forms that build the gnokey command for Set and Delete. Anyone can see them; only the authority's signature makes the resulting transaction succeed.

Open
OID
0f08db…abe6:62
renderEdit details

Inspect func

attr

func(s string) string

attr escapes s for a double-quoted attribute of a gnoweb form tag, which must sit on one line: newlines and tabs become the \\n and \\t sequences the textarea unfolds.

Open
OID
0f08db…abe6:63
attr details

Inspect func

renderSystem

func() string

renderSystem shows the upgrade wiring and offers the Accept form.

Open
OID
0f08db…abe6:64
renderSystem details

Inspect func
Admin : .uverse.address =<gnolang.StringValue>
LayoutSlug : untyped string ="layout"
StylePrefix : untyped string ="style."
maxSlugLen : untyped bigint =(64 <untyped> bigint)
Theme : type =home.Theme
Slot : type =home.Slot
proxy : *v0.Proxy Inspect
selfPath : string ="gno.land/r/g1lnkytfqcjwllws63gvf0mv9yt04aswy4y9amhm/home"
slots : *v0.Tree Inspect
rev : int =17
lastHeight : int64 =241605
init.11 : func() Inspect
assertAuthority : func() Inspect
reservedSlugs : []string (len=8) 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
write : func(slug string, body string) Inspect
bump : func() Inspect
Get : func(slug string) string Inspect
Has : func(slug string) bool Inspect
Lookup : func(slug string) (home.Slot, bool) Inspect
Slugs : func() []string Inspect
Each : func(fn func(...)) Inspect
Style : func(key string, fallback string) string Inspect
Layout : func() string Inspect
Revision : func() int Inspect
LastHeight : func() int64 Inspect
Manifest : func() string Inspect
Path : func() string Inspect
Register : func(t home.Theme) Inspect
Accept : func(pkgPath string) Inspect
Withdraw : func(pkgPath string) Inspect
Rollback : func() Inspect
Forget : func() Inspect
Freeze : func() Inspect
TransferAuthority : func(to .uverse.address) Inspect
LivePath : func() string Inspect
PendingPaths : func() []string Inspect
HistoryPaths : func() []string Inspect
Frozen : func() bool Inspect
Authority : func() string Inspect
liveTheme : func() (home.Theme, bool) Inspect
Render : func(path string) string Inspect
operatorPaths : []string (len=4) Inspect
isOperatorPath : func(path string) bool Inspect
cleanPath : func(path string) string Inspect
Fallback : func(path string) string Inspect
Filler : type =home.Filler
NewFiller : func() *home.Filler Inspect
updated : func() string Inspect
defaultLayout : func() string Inspect
renderPage : func() string Inspect
renderIndex : func() string Inspect
renderSlot : func(slug string) string Inspect
fence : func(body string) string Inspect
renderEdit : func(slug string) string Inspect
attr : func(s string) string Inspect
renderSystem : func() string Inspect