Documentation
¶
Overview ¶
Package api is WittyCD's own HTTP API and SDUI source (module API 5): finding which album an audio CD is. WittyMediaServer passes an administrator's request for /api/modules/wittycd/... here once it has checked who is asking and that they may see the disc (integration.json).
The lookups themselves are the server's, through its host API: the process that reads disc images never has a network, so the server asks MusicBrainz with the disc's table of contents and fetches the cover, as its library scan does. This is the route a person (or a TV's page) reaches, and what it shows.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Guard ¶
Guard lets in only whoever was told the start's secret, which is the server: a port on this machine can be reached by anything else running on it.
func Items ¶
func Items(h Host, req sdui.ItemsRequest) (sdui.ItemsAnswer, error)
Items answers the server's sdui.items call for WittyCD's source.
Types ¶
type Dual ¶
type Dual struct {
Helper wittymodule.Handler
// contains filtered or unexported fields
}
Dual is one process answering as either of the two things a server starts wittycd-module as:
- a helper with one open image, as it always was (Helper), started for each disc played, and never given a network;
- WittyCD's service (module API 5): the server's first call is then service.MethodStart, with where its host API is. It listens on this machine only, with a secret of its own, for the routes the server passes on, and answers the SDUI and lifecycle calls.
wittymodule/service.Main runs a service only, and answers every other call with "unknown-method", so it can't also be the helper a server asks about one image: this is that part of it, with the same guard (a WittyModule gap: a service with helper calls of its own).