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

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

v1.post

posts

[]v1.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
0c0fb1…9ac8:4
Post details

Inspect func

Count

func() int

Count returns the total number of posts on the wall.

Open
OID
0c0fb1…9ac8: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
0c0fb1…9ac8: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
0c0fb1…9ac8: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
0c0fb1…9ac8:9
parsePage details

Inspect func
maxMsgLen : untyped bigint =(280 <untyped> bigint)
pageSize : untyped bigint =(20 <untyped> bigint)
post : type =v1.post
posts : []v1.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