DemoKey
untyped stringDemoKey names the namespace gnoweb browses when no ?u= is given. It is a plain string rather than an address so it can never collide with one.
Value
"demo"
service
typeValue
v0.service
space
typeValue
v0.space
services
*v0.Tree// name -> \*service
- OID
- 059cc5…2e9f:4
services details
spaces
*v0.Tree// address string (or DemoKey) -> \*space
- OID
- 059cc5…2e9f:7
spaces details
init.5
func()- OID
- 059cc5…2e9f:9
init.5 details
srvDir
typesrvDir is the synthetic directory that makes posted services reachable by name. It is written out by hand rather than built with synfs because its contents change as realms post, and because implementing ninep.File directly is meant to look easy: four methods, no state of its own.
Value
v0.srvDir
srvRoot
*v0.srvDir- OID
- 059cc5…2e9f:12
srvRoot details
Post
func(name string, f v0.File)Post publishes a file tree under name in /srv, where any account can bind it. The posting realm is recorded and is the only one that may Unpost. Names are first come, first served, which is fine for an experiment and would not be for anything else.
- OID
- 059cc5…2e9f:14
Post details
Unpost
func(name string)Unpost withdraws a service. Only the realm that posted it may do so.
- OID
- 059cc5…2e9f:15
Unpost details
Services
func() []stringServices lists the posted service names, in order.
- OID
- 059cc5…2e9f:16
Services details
newSpace
func(owner string) *v0.spacenewSpace builds the default namespace, which is this chain's /lib/namespace: a private ram root, the mount points that Plan 9 requires to exist before anything can be bound onto them, /srv mounted, and /dev bound from it when a device server has been posted.
- OID
- 059cc5…2e9f:17
newSpace details
spaceFor
func(key string) *v0.space- OID
- 059cc5…2e9f:18
spaceFor details
peek
func(key string) *v0.space- OID
- 059cc5…2e9f:19
peek details
seedDemo
func()seedDemo builds the namespace gnoweb shows by default. It is deliberately reproducible: an example test resets it before rendering.
- OID
- 059cc5…2e9f:20
seedDemo details
ResetDemo
func()ResetDemo rebuilds the demo namespace. Anyone may call it: it is a demo, and the alternative is a demo that the first visitor ruins for everybody.
- OID
- 059cc5…2e9f:21
ResetDemo details
Exec
func(line string) stringExec runs a command line against the CALLER's namespace and returns its output. The namespace belongs to cur.Previous().Address(), so a user gets theirs and a realm gets its own. An error panics, so a half-applied command line reverts with the transaction rather than leaving a namespace nobody asked for.
- OID
- 059cc5…2e9f:22
Exec details
Reset
func()Reset discards the caller's namespace, so the next use rebuilds the default.
- OID
- 059cc5…2e9f:23
Reset details
Run
func(key string, line string) (string, .uverse.error)Run executes a READ-ONLY command line against key's namespace. It is the query side of Exec: no transaction, no writes, safe from Render.
- OID
- 059cc5…2e9f:24
Run details
Namespace
func(key string) stringNamespace returns key's mount table, in ns(1) format.
- OID
- 059cc5…2e9f:25
Namespace details
Keys
func() []stringKeys lists the namespaces that exist, in order.
- OID
- 059cc5…2e9f:26
Keys details
Render
func(path string) stringRender browses a namespace. Render("") overview, posted services, how to drive it Render("ns?u=<key>") the mount table Render("ls/bin?u=<key>") a directory listing (ls -l) Render("cat/tmp/greeting") a file Render("stat/bin") the 9P stat, with the union width Render("walk/bin/rc") how each element of a path resolves Render("rc?c=<command>") any read-only rc command line ?u= selects the namespace; it defaults to the demo one.
- OID
- 059cc5…2e9f:27
Render details
renderCmd
func(key string, line string, title string) string- OID
- 059cc5…2e9f:28
renderCmd details
renderHome
func(key string) string- OID
- 059cc5…2e9f:29
renderHome details
quote
func(s string) stringquote wraps a path for rc if it needs it.
- OID
- 059cc5…2e9f:30