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

v1 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"

MaxServices

untyped bigint

The bounds on what callers can create. Any realm may Post a service and any account gets a namespace on its first Exec; the home page lists both.

Value

(64 <untyped> bigint)

MaxNamespaces

untyped bigint

The bounds on what callers can create. Any realm may Post a service and any account gets a namespace on its first Exec; the home page lists both.

Value

(1000 <untyped> bigint)

HomeRecent

untyped bigint

// namespaces the home page lists

Value

(50 <untyped> bigint)

service

type

Value

v1.service

space

type

Value

v1.space

spaces

*v0.Tree

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

Open
OID
058fd5…28b1: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

v1.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
058fd5…28b1:14
Post details

Inspect func

Unpost

func(name string)

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

Open
OID
058fd5…28b1:15
Unpost details

Inspect func

Services

func() []string

Services lists the posted service names, in order.

Open
OID
058fd5…28b1:16
Services details

Inspect func

newSpace

func(owner string) *v1.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
058fd5…28b1:17
newSpace details

Inspect func

spaceFor

func(key string) *v1.space
Open
OID
058fd5…28b1: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
058fd5…28b1: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
058fd5…28b1: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
058fd5…28b1:22
Exec details

Inspect func

Reset

func()

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

Open
OID
058fd5…28b1: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
058fd5…28b1:24
Run details

Inspect func

Namespace

func(key string) string

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

Open
OID
058fd5…28b1:25
Namespace details

Inspect func

Keys

func() []string

Keys lists the namespaces that exist, in order.

Open
OID
058fd5…28b1: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
058fd5…28b1:27
Render details

Inspect func

renderCmd

func(key string, line string, title string) string
Open
OID
058fd5…28b1:28
renderCmd details

Inspect func

renderHome

func(key string) string
Open
OID
058fd5…28b1:29
renderHome details

Inspect func

quote

func(s string) string

quote wraps a path for rc if it needs it.

Open
OID
058fd5…28b1:30
quote details

Inspect func
DemoKey : untyped string ="demo"
MaxServices : untyped bigint =(64 <untyped> bigint)
MaxNamespaces : untyped bigint =(1000 <untyped> bigint)
HomeRecent : untyped bigint =(50 <untyped> bigint)
service : type =v1.service
space : type =v1.space
services : *v0.Tree Inspect
spaces : *v0.Tree Inspect
init.8 : func() Inspect
srvDir : type =v1.srvDir
srvRoot : *v1.srvDir Inspect
Post : func(name string, f v0.File) Inspect
Unpost : func(name string) Inspect
Services : func() []string Inspect
newSpace : func(owner string) *v1.space Inspect
spaceFor : func(key string) *v1.space Inspect
peek : func(key string) *v1.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