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 ¶
- func Hub(st *storehub.Store, dataDir string, log *slog.Logger) storehub.AppsViewer
- type Options
- type Rooms
- type View
- func (v *View) Kinds(ctx context.Context, spaceID string) ([]hubproto.AppKind, error)
- func (v *View) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (v *View) ServeMember(w http.ResponseWriter, r *http.Request, spaceID, person string)
- func (v *View) SpaceApps(ctx context.Context, spaceID string) ([]hubproto.SpaceApp, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*View) Kinds ¶
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 ¶
ServeMember answers /apps/space/<space>/<app>/... for a person of the space, named as the store names them (storehub.PersonName).