Post
typePost is a single blog entry.
Value
v0.Post
posts
v0.Tree// key: zero-padded id string -> \*Post
- OID
- 038755…08b2:4
posts details
nextID
intposts holds every published post keyed by its zero-padded id (for deterministic ordering) and nextID is the id assigned to the next post.
Value
0
key
func(id int) stringkey returns a fixed-width, zero-padded key so avl.Tree iteration is ordered by numeric id (and thus by publication order).
- OID
- 038755…08b2:6
key details
Publish
func(title string, body string) intPublish creates a new post authored by the caller and returns its id. It is a state-mutating exported function, so it takes \`cur realm\`.
- OID
- 038755…08b2:8
Publish details
PostCount
func() intPostCount returns the number of published posts.
- OID
- 038755…08b2:9
PostCount details
snippet
func(body string) stringsnippet returns a short one-line preview of the body.
- OID
- 038755…08b2:10
snippet details
Render
func(path string) stringRender lists all posts newest-first at the root, or a single post's full text at path "/\<id>". Render is NOT a crossing function.
- OID
- 038755…08b2:11
Render details
renderList
func() string- OID
- 038755…08b2:12
renderList details
renderPost
func(p *v0.Post) string- OID
- 038755…08b2:13
renderPost details
Post
:
type
=v0.Post
posts : v0.Tree Inspect
nextID
:
int
=0