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

v1 state

Back to all declarations

Entry

type

Entry is a single signed guestbook line. It carries no ID field: the id belongs to the store, which hands it back on lookup and iteration.

Value

v1.Entry

maxMessageLen

untyped bigint

Value

(280 <untyped> bigint)

entries

*v0.Store

entries assigns the sequence numbers. v1 kept its own count plus a seqKey() that zero-padded to width 16, the widest of the six hand-rolled variants in this repo and still a ceiling; the store key has none.

Open
OID
03b7ab…eb1f:4
entries details

Inspect pointer

Sign

func(message string)

Sign appends a new entry to the guestbook attributed to the immediate caller. It is a crossing function (gno 0.9 interrealm convention): callers invoke it as Sign(cross(cur), "hello"). The cur.IsCurrent() guard is the authentication primitive — without it a stale/forged realm value could spoof the author.

Open
OID
03b7ab…eb1f:7
Sign details

Inspect func

addEntry

func(author string, message string, height int64) (v0.ID, *v1.Entry)

addEntry validates the message and appends an entry. Non-crossing internal helper so the append/validation logic is unit-testable without a realm frame. Panics (aborting the tx, reverting state) on an invalid message.

Open
OID
03b7ab…eb1f:9
addEntry details

Inspect func

Count

func() int

Count returns the total number of signatures. Read-only, non-crossing.

Open
OID
03b7ab…eb1f:10
Count details

Inspect func

Render

func(path string) string

Render lists every entry newest-first as a Markdown table plus a total count.

Open
OID
03b7ab…eb1f:11
Render details

Inspect func
Entry : type =v1.Entry
maxMessageLen : untyped bigint =(280 <untyped> bigint)
entries : *v0.Store Inspect
Sign : func(message string) Inspect
addEntry : func(author string, message string, height int64) (v0.ID, *v1.Entry) Inspect
Count : func() int Inspect
Render : func(path string) string Inspect