viewonly

package
v0.16.521 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package viewonly is what a person who may only watch a machine reaches there (docs/hub/own-work.md, «Levels»). The hub applies it to every request of such a person, which also covers machines that run an older runtime; the runtime applies it again to a session the hub asked for as a watcher's.

Both lists are allow-lists of what the watching page asks for: a route that is not here is closed. Routes that hand over files of the machine (downloads, previews, the file pane, notebooks, the folder browser), terminals, secrets, settings of agents and the preview of the owner's dev servers are left out on purpose.

Index

Constants

View Source
const Level = "view"

Level is the value of a session's "level" claim for a watcher.

Variables

This section is empty.

Functions

func Message

func Message(path string, data []byte) ([]byte, bool)

Message is a message of a watcher's page on the socket at path, rewritten to what may go on to the runtime; false drops it. The type is read from the key "type" exactly, as the runtime reads it, and the message is written anew without any other spelling of that key, so both sides read the same one.

func MessageType

func MessageType(path, typ string) bool

MessageType says a message of this type from a watcher's page may be acted on.

func Readable

func Readable(path, escaped string) bool

Readable says a watcher may read (GET, HEAD, OPTIONS) the runtime's path: path is the decoded path without the runtime's mount, escaped the same request's path as it was written. Outside /api lie the page and its files.

func Socket

func Socket(path string) bool

Socket says a watcher may open the socket at the runtime's path (without any mount of the runtime).

func Watching

func Watching(ctx context.Context) bool

Watching says the request is a watcher's.

func With

func With(ctx context.Context) context.Context

With marks a request as a watcher's.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL