appsview

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: 17 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 appsview is the hub's own serving of a harnessly app's guest link: the page, the view's files and the link's area of the storage, all from the space's apps collection of the hub's store, so a link opens with the machine that made it off. The machine puts its live links there (guests/<person>/<hash>.json, never the token) and the app's package (bundles/<app>/<sum>.tgz); the hub finds a link by the token's hash, checks the archive against its sum, unpacks it into a folder of its own and answers with the runtime's own guest code (apps.Guests). What a guest may do is what it may on the machine: the view, its theme and the link's storage, nothing of the machine.

The hub's API does not import this package (the apps import the agent, whose tests import the API); the hub's main sets api.AppsView to Hub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hub

func Hub(st *storehub.Store, dataDir string, log *slog.Logger) storehub.AppsViewer

Hub is the view over the hub's store, as the hub's API takes it (api.AppsView).

Types

type Options

type Options struct {
	Rooms Rooms
	// Dir holds the unpacked packages (<data>/apps-view).
	Dir string
	Log *slog.Logger
	// Rescan is the least time between two looks through every space for a link the hub does not know yet.
	Rescan time.Duration
}

Options configure the view.

type Rooms

type Rooms interface {
	AppsRoom(ctx context.Context, spaceID string) (*filestore.Store, error)
	AppsSpaces(ctx context.Context) ([]string, error)
}

Rooms is the hub's store as the view reads it (storehub.Store).

type View

type View struct {
	// contains filtered or unexported fields
}

View serves the guest links of every space.

func New

func New(o Options) *View

New is the view; nil without rooms.

func (*View) Kinds

func (v *View) Kinds(ctx context.Context, spaceID string) ([]hubproto.AppKind, error)

Kinds are the document types of the apps installed for a space, read from the packages of its team in the store (the hub's GET <platform>/apps/kinds under hub-apps-catalog). An app whose package is refused adds none.

func (*View) ServeHTTP

func (v *View) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP answers /apps/guest/<token>/...

func (*View) ServeMember

func (v *View) ServeMember(w http.ResponseWriter, r *http.Request, spaceID, person string)

ServeMember answers /apps/space/<space>/<app>/... for a person of the space, named as the store names them (storehub.PersonName).

func (*View) SpaceApps

func (v *View) SpaceApps(ctx context.Context, spaceID string) ([]hubproto.SpaceApp, error)

SpaceApps is the apps installed for a space, as the store's team has them.

Jump to

Keyboard shortcuts

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