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

Post

type

Post is a single blog entry. It carries no id field: the id belongs to the store, which hands it back on lookup and iteration.

Value

v1.Post

posts

*v0.Store

posts holds every published post. The store keys by seqid, so iteration is in publication order for any number of posts; v0 kept its own nextID plus a key() that zero-padded to width 12 and stopped ordering past it.

Open
OID
0e45f2…8453:4
posts details

Inspect pointer

Publish

func(title string, body string) int

Publish creates a new post authored by the caller and returns its id. It is a state-mutating exported function, so it takes \`cur realm\`.

Open
OID
0e45f2…8453:7
Publish details

Inspect func

PostCount

func() int

PostCount returns the number of published posts.

Open
OID
0e45f2…8453:9
PostCount details

Inspect func

snippet

func(body string) string

snippet returns a short one-line preview of the body.

Open
OID
0e45f2…8453:10
snippet details

Inspect func

Render

func(path string) string

Render lists all posts newest-first at the root, or a single post's full text at path "/\<id>". Render is NOT a crossing function.

Open
OID
0e45f2…8453:11
Render details

Inspect func

renderPost

func(p *v1.Post) string
Open
OID
0e45f2…8453:13
renderPost details

Inspect func
Post : type =v1.Post
posts : *v0.Store Inspect
Publish : func(title string, body string) int Inspect
PostCount : func() int Inspect
snippet : func(body string) string Inspect
Render : func(path string) string Inspect
renderList : func() string Inspect
renderPost : func(p *v1.Post) string Inspect