Documentation
¶
Overview ¶
Package api is WittyCouch's own HTTP API (module API 5): the routes WittyMediaServer passes to it at /api/modules/wittycouch/... once it has checked that someone is signed in (integration.json), the sources of its SDUI pages, and its lifecycle. It keeps each person's PCs in WittyCouch's own database (package store) and their keys and the PCs' pictures in its own folder, and asks the server only what only the server knows, through the host API: its settings, where the WittyCouch Host program is, and when an account goes.
This makes the server connect where a person says, which needs care:
- The connections only speak this one protocol, on its own ports, to fixed paths. Answers are parsed into a few fields, and nothing a far end says is passed back raw, so this can't be used to read other services or as a general network probe.
- What was refused and what timed out read the same to anyone but an admin, as the difference is what a port scanner wants.
- Attempts are limited per person, and nobody but an admin reaches this machine itself.
- Each person's certificate and pairings are their own, kept apart, and never shown.
- Who may use it, and which networks it may reach, are an admin's settings.
Index ¶
Constants ¶
const DataEnv = "WITTYMODULE_DATA"
DataEnv is where the server says WittyCouch's own folder is.
const HeaderLimited = "X-Witty-Limited"
HeaderLimited is "1" on a request from a profile with limits set (age, libraries, screen time).
Variables ¶
This section is empty.
Functions ¶
func Busy ¶
func Busy() bool
Busy says a stream is running (service.Config.Busy), so the service isn't stopped for being idle.
func Lifecycle ¶
func Lifecycle(ctx context.Context, call string, args wittymodule.LifecycleArgs) error
Lifecycle answers the lifecycle calls integration.json says WittyCouch answers: taken off without keeping its data, its folder (database, keys, pictures) goes.
func SDUIItems ¶
func SDUIItems(req sdui.ItemsRequest) (sdui.ItemsAnswer, error)
SDUIItems answers the server's sdui.items call for WittyCouch's sources.
Types ¶
type App ¶
type App struct {
DB *store.DB
Dir string
Host *host.Client
Log *slog.Logger
// contains filtered or unexported fields
}
App is what the routes need: WittyCouch's database and folder, the way back to the server, and what's in memory: identities, pairings, streams.
func Get ¶
Get opens WittyCouch's database and reaches the server the first time something needs them.