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

DemoKey

untyped string

DemoKey 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

type

Value

v0.service

space

type

Value

v0.space

spaces

*v0.Tree

// address string (or DemoKey) -> \*space

Open
OID
059cc5…2e9f:7
spaces details

Inspect pointer

srvDir

type

srvDir 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

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.

Open
OID
059cc5…2e9f:14
Post details

Inspect func

Unpost

func(name string)

Unpost withdraws a service. Only the realm that posted it may do so.

Open
OID
059cc5…2e9f:15
Unpost details

Inspect func

Services

func() []string

Services lists the posted service names, in order.

Open
OID
059cc5…2e9f:16
Services details

Inspect func

newSpace

func(owner string) *v0.space

newSpace 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.

Open
OID
059cc5…2e9f:17
newSpace details

Inspect func

spaceFor

func(key string) *v0.space
Open
OID
059cc5…2e9f:18
spaceFor details

Inspect func

seedDemo

func()

seedDemo builds the namespace gnoweb shows by default. It is deliberately reproducible: an example test resets it before rendering.

Open
OID
059cc5…2e9f:20
seedDemo details

Inspect func

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.

Open
OID
059cc5…2e9f:21
ResetDemo details

Inspect func

Exec

func(line string) string

Exec 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.

Open
OID
059cc5…2e9f:22
Exec details

Inspect func

Reset

func()

Reset discards the caller's namespace, so the next use rebuilds the default.

Open
OID
059cc5…2e9f:23
Reset details

Inspect func

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.

Open
OID
059cc5…2e9f:24
Run details

Inspect func

Namespace

func(key string) string

Namespace returns key's mount table, in ns(1) format.

Open
OID
059cc5…2e9f:25
Namespace details

Inspect func

Keys

func() []string

Keys lists the namespaces that exist, in order.

Open
OID
059cc5…2e9f:26
Keys details

Inspect func

Render

func(path string) string

Render 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.

Open
OID
059cc5…2e9f:27
Render details

Inspect func

renderCmd

func(key string, line string, title string) string
Open
OID
059cc5…2e9f:28
renderCmd details

Inspect func

renderHome

func(key string) string
Open
OID
059cc5…2e9f:29
renderHome details

Inspect func

quote

func(s string) string

quote wraps a path for rc if it needs it.

Open
OID
059cc5…2e9f:30
quote details

Inspect func
DemoKey : untyped string ="demo"
service : type =v0.service
space : type =v0.space
services : *v0.Tree Inspect
spaces : *v0.Tree Inspect
init.5 : func() Inspect
srvDir : type =v0.srvDir
srvRoot : *v0.srvDir Inspect
Post : func(name string, f v0.File) Inspect
Unpost : func(name string) Inspect
Services : func() []string Inspect
newSpace : func(owner string) *v0.space Inspect
spaceFor : func(key string) *v0.space Inspect
peek : func(key string) *v0.space Inspect
seedDemo : func() Inspect
ResetDemo : func() Inspect
Exec : func(line string) string Inspect
Reset : func() Inspect
Run : func(key string, line string) (string, .uverse.error) Inspect
Namespace : func(key string) string Inspect
Keys : func() []string Inspect
Render : func(path string) string Inspect
renderCmd : func(key string, line string, title string) string Inspect
renderHome : func(key string) string Inspect
quote : func(s string) string Inspect