Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v1 state

Back to all declarations

selfPath

untyped string

selfPath is this realm's own page. A root-relative link resolves against the domain, not the realm, so every link back into it names it in full.

Value

"/r/moul/x/daily/blog/v1"

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:16
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:19
Publish details

Inspect func

PostCount

func() int

PostCount returns the number of published posts.

Open
OID
0e45f2…8453:21
PostCount 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:22
Render details

Inspect func

renderPost

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

Inspect func
selfPath : untyped string ="/r/moul/x/daily/blog/v1"
Post : type =v1.Post
posts : *v0.Store Inspect
Publish : func(title string, body string) int Inspect
PostCount : func() int Inspect
Render : func(path string) string Inspect
renderList : func() string Inspect
renderPost : func(p *v1.Post) string Inspect