Documentation
¶
Overview ¶
Package capabilities is the one answer to «what does this server do»: GET /api/capabilities, served by the hub and by the runtime in the same shape. It reads the mechanisms that already exist (the hub's feature flags, the runtime's RUNTIME_WEB_FEATURES and service settings) and breaks none of them: it only says, per capability, whether it is on, off, or on once something is configured, and which setting that is.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability struct {
ID string `json:"id"`
Status Status `json:"status"`
// Reason says why it is not on; empty for a capability that is on.
Reason string `json:"reason,omitempty"`
// Configure names the setting that turns it on (an environment variable, a flag), when there is one.
Configure string `json:"configure,omitempty"`
}
Capability is one thing the web can ask the server to do.
type Document ¶
type Document struct {
// Server is "hub" or "runtime".
Server string `json:"server"`
Capabilities []Capability `json:"capabilities"`
}
Document is the body of GET /api/capabilities.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
Set collects the capabilities of a server.
type Status ¶
type Status string
Status is where a capability stands on this server.
const ( // On: the server serves it. On Status = "on" // Off: the server does not serve it, and nothing a person sets in it changes that (or it was switched off). Off Status = "off" // NeedsConfig: the server can serve it once the setting named in Configure is made. NeedsConfig Status = "needs_config" )