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

item

type

item is one entry on the board. \`address\` is the uverse bech32 type — it is persistable (unlike a \`realm\` value), so it is safe to store across txs. It carries no id field: the id belongs to the store, which hands it back on lookup and iteration.

Value

v1.item

items

*v0.Store

items assigns the item ids. v1 kept its own nextID plus an idKey() that zero-padded to width 12, which stopped ordering Render past 10^12.

Open
OID
07cd4e…4d59:4
items details

Inspect pointer

Add

func(text string) int

Add appends a new item authored by the caller and returns its id. Crossing function: takes \`cur realm\` first (gno 0.9 interrealm convention), authenticates with cur.IsCurrent() before trusting cur.Previous().

Open
OID
07cd4e…4d59:7
Add details

Inspect func

Toggle

func(id int)

Toggle flips the done state of the item with the given id.

Open
OID
07cd4e…4d59:9
Toggle details

Inspect func

Remove

func(id int)

Remove deletes the item with the given id.

Open
OID
07cd4e…4d59:10
Remove details

Inspect func

counts

func() (open int, done int)

counts returns the number of open and done items.

Open
OID
07cd4e…4d59:11
counts details

Inspect func

Render

func(path string) string

Render returns the board as Markdown. Newest item (highest id) first. Render is NOT a crossing function (no \`cur realm\` param) — it is read-only and invoked by gnoweb, not via MsgCall.

Open
OID
07cd4e…4d59:12
Render details

Inspect func
item : type =v1.item
items : *v0.Store Inspect
Add : func(text string) int Inspect
Toggle : func(id int) Inspect
Remove : func(id int) Inspect
counts : func() (open int, done int) Inspect
Render : func(path string) string Inspect