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

v0 state

Back to all declarations

maxMsgLen

untyped bigint

maxMsgLen is the maximum length (in bytes) of a single post.

Value

(280 <untyped> bigint)

pageSize

untyped bigint

pageSize is how many posts a single Render page shows.

Value

(20 <untyped> bigint)

post

type

post is a single microblog entry.

Value

v0.post

posts

[]v0.post

posts is the append-only wall, in chronological (oldest-first) order. Render reverses this view to show newest-first.

Value

<zero>

Post

func(msg string)

Post publishes msg to the wall. It is a crossing function: callers invoke it with Post(cross(cur), "hello"). It panics if msg is empty or longer than maxMsgLen bytes.

Open
OID
0fe833…b447:4
Post details

Inspect func

Count

func() int

Count returns the total number of posts on the wall.

Open
OID
0fe833…b447:6
Count details

Inspect func

Render

func(path string) string

Render renders the wall as Markdown, newest-first, pageSize posts per page. The page is parsed from path: "?page=N", "?p=N", "/N", or a bare "N" all select page N (1-indexed). Anything else defaults to page 1.

Open
OID
0fe833…b447:7
Render details

Inspect func

renderNav

func(page int, pages int) string

renderNav builds a simple prev/next navigation footer as Markdown links.

Open
OID
0fe833…b447:8
renderNav details

Inspect func

parsePage

func(path string) int

parsePage extracts the 1-indexed page number from a Render path. It accepts "?page=N", "?p=N", "/N", and a bare "N". Unrecognized input yields page 1.

Open
OID
0fe833…b447:9
parsePage details

Inspect func

shortAddr

func(addr string) string

shortAddr abbreviates a bech32 address for display: g1abcd…wxyz.

Open
OID
0fe833…b447:10
shortAddr details

Inspect func

escapeInline

func(s string) string

escapeInline neutralizes characters that would break the Markdown list item layout (newlines collapse to spaces; leading markers are defused).

Open
OID
0fe833…b447:11
escapeInline details

Inspect func
maxMsgLen : untyped bigint =(280 <untyped> bigint)
pageSize : untyped bigint =(20 <untyped> bigint)
post : type =v0.post
posts : []v0.post =<zero>
Post : func(msg string) Inspect
Count : func() int Inspect
Render : func(path string) string Inspect
renderNav : func(page int, pages int) string Inspect
parsePage : func(path string) int Inspect
shortAddr : func(addr string) string Inspect
escapeInline : func(s string) string Inspect