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

basePath

untyped string

basePath is this realm's render path. It is a constant rather than a lookup so link building stays a pure string operation, and it is asserted against the real path by TestBasePathMatchesTheRealm.

Value

"/r/moul/x/wiki/v0"

steward

.uverse.address

Value

<gnolang.StringValue>

cooldown

int64

Value

0

lastEdit

v0.Tree

// address -> the height of that address's last edit

Open
OID
04be2b…265b:13
lastEdit details

Inspect ref

editCount

int

Value

0

Edit

func(title string, body string, summary string) int

Edit creates or updates a page and returns the new revision id.

Open
OID
04be2b…265b:17
Edit details

Inspect func

Revert

func(title string, rev int, summary string) int

Revert restores an earlier revision of a page as a new revision.

Open
OID
04be2b…265b:18
Revert details

Inspect func

Comment

func(title string, body string, replyTo int) int

Comment appends a message to a page's discussion and returns its id. Pass replyTo = 0 for a new thread, or the id of a top-level message to reply to. Commenting deliberately ignores the page's protection level: locking an article is how a steward stops an edit war, and the discussion is where that war is supposed to move. A banned address still cannot comment, and the cooldown still applies.

Open
OID
04be2b…265b:19
Comment details

Inspect func

HideComment

func(title string, id int) int

HideComment clears one message's body and returns the bytes released. The message stays in the thread, marked as removed.

Open
OID
04be2b…265b:20
HideComment details

Inspect func

Protect

func(title string, level string)

Protect sets a page's edit gate: "open", "semi" or "locked".

Open
OID
04be2b…265b:21
Protect details

Inspect func

Move

func(from string, to string, reason string)

Move renames a page, keeping its history and leaving a redirect behind.

Open
OID
04be2b…265b:22
Move details

Inspect func

Blank

func(title string, reason string)

Blank replaces a page's content with a tombstone revision. The history stays.

Open
OID
04be2b…265b:23
Blank details

Inspect func

Purge

func(title string) int

Purge drops every body this realm still holds for a page and returns the number of bytes released. Use it for content that must stop being served from realm state; it cannot remove the transactions that wrote it.

Open
OID
04be2b…265b:24
Purge details

Inspect func

AddEditor

func(addr .uverse.address)

AddEditor lets an address write to semi-protected pages.

Open
OID
04be2b…265b:25
AddEditor details

Inspect func

RemoveEditor

func(addr .uverse.address)

RemoveEditor revokes semi-protected write access.

Open
OID
04be2b…265b:26
RemoveEditor details

Inspect func

Ban

func(addr .uverse.address)

Ban stops an address from editing anything.

Open
OID
04be2b…265b:27
Ban details

Inspect func

Unban

func(addr .uverse.address)

Unban lifts a ban.

Open
OID
04be2b…265b:28
Unban details

Inspect func

SetCooldown

func(blocks int)

SetCooldown sets the minimum number of blocks between two edits by the same address; 0 disables it.

Open
OID
04be2b…265b:29
SetCooldown details

Inspect func

assertNotBanned

func(caller .uverse.address)

assertNotBanned is the floor every write shares: the ban list and the per-address cooldown.

Open
OID
04be2b…265b:30
assertNotBanned details

Inspect func

assertMayEdit

func(caller .uverse.address, title string)

assertMayEdit is the whole authority model of this wiki, in one function.

Open
OID
04be2b…265b:31
assertMayEdit details

Inspect func

noteEdit

func(caller .uverse.address)
Open
OID
04be2b…265b:32
noteEdit details

Inspect func

ctx

func() v0.Ctx

ctx is the render context handed to the library on every read.

Open
OID
04be2b…265b:33
ctx details

Inspect func

Render

func(path string) string

Render is the whole read surface of the wiki. Routes: the front page Title an article Title/history[?offset=] its revisions, newest first Title/raw the current source, with its hash Title/rev/<id> one stored revision Title/diff?from=&to= a line diff between two revisions Title/talk[?offset=] the page's discussion Category:Name a category page and its members Special:AllPages[?ns=] the page index for a namespace Special:Categories every category with at least one member Special:RecentChanges the change feed Special:Backlinks?page= what links to a page Special:Stats size and storage cost

Open
OID
04be2b…265b:34
Render details

Inspect func

renderSpecial

func(c v0.Ctx, name string, req *v0.Request) string
Open
OID
04be2b…265b:35
renderSpecial details

Inspect func

intParam

func(s string, def int) int

intParam parses a decimal parameter, falling back to def. It never panics: Render is reached from a URL, and a malformed query must render a page, not abort the query.

Open
OID
04be2b…265b:36
intParam details

Inspect func

seed

func()

seed writes the pages the wiki starts with, so a fresh deploy renders something a reader can follow instead of an empty index.

Open
OID
04be2b…265b:37
seed details

Inspect func
basePath : untyped string ="/r/moul/x/wiki/v0"
steward : .uverse.address =<gnolang.StringValue>
site : *v0.Wiki Inspect
Ownable : *v0.Ownable Inspect
editors : v1.Set Inspect
banned : v1.Set Inspect
cooldown : int64 =0
lastEdit : v0.Tree Inspect
editCount : int =0
init.9 : func() Inspect
Edit : func(title string, body string, summary string) int Inspect
Revert : func(title string, rev int, summary string) int Inspect
Comment : func(title string, body string, replyTo int) int Inspect
HideComment : func(title string, id int) int Inspect
Protect : func(title string, level string) Inspect
Move : func(from string, to string, reason string) Inspect
Blank : func(title string, reason string) Inspect
Purge : func(title string) int Inspect
AddEditor : func(addr .uverse.address) Inspect
RemoveEditor : func(addr .uverse.address) Inspect
Ban : func(addr .uverse.address) Inspect
Unban : func(addr .uverse.address) Inspect
SetCooldown : func(blocks int) Inspect
assertNotBanned : func(caller .uverse.address) Inspect
assertMayEdit : func(caller .uverse.address, title string) Inspect
noteEdit : func(caller .uverse.address) Inspect
ctx : func() v0.Ctx Inspect
Render : func(path string) string Inspect
renderSpecial : func(c v0.Ctx, name string, req *v0.Request) string Inspect
intParam : func(s string, def int) int Inspect
seed : func() Inspect