Documentation
¶
Overview ¶
Package capdemo is the M2 capability-broker showcase app. One window, four sections: a fs.dialog.read round-trip (pick a file, get a handle, fetch contents), a runtime.persist.{ownAlias}.scratchpad round-trip (save / load / delete a TextEdit's contents), an fs.dialog.watch round-trip (pick a folder, stream change events on fs.handle.{uuid}.event), and a status pane showing what's pending. Demonstrates that an app declaring the right Caps gets working Bus() and Storage() through MountContextI without any direct syscalls.
Lifecycle: Mount captures the BusI and StorageI from the context. The file dialog flow runs in a goroutine because bus.Request blocks until the picker resolves; results land in fields guarded by `mu` and rendered on the next Frame.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
App is the per-window capdemo instance. Mount captures bus + storage from the MountContextI; Frame renders the three sections; Unmount is a no-op (the goroutine guards against use-after-unmount by checking app state before mutating).
func (*App) Frame ¶
func (inst *App) Frame(ctx app.FrameContextI) (err error)
Frame renders the three demo sections. Body is wrapped in IdScope(seed) so per-instance widget ids stay disjoint across multiple open windows.
func (*App) Mount ¶
func (inst *App) Mount(ctx app.MountContextI) (err error)
Mount captures the per-app BusI and StorageI handles. The values are dormant on M1 hosts (NoopBus / NoopStorage) — every call errors with a documented "not available" message; on M2 hosts (carousel Phase A+B+C wiring) they are real inprocbus.Client / persist.Client. Either way, Mount itself is infallible.