Documentation
¶
Overview ¶
Package features is the organizations' flags: parts of the hub that are switched on for an organization at a time (docs/hub/api.md, «Feature flags»). Everything new in the hub ships dark behind one of them.
A flag is on for an organization when, in this order: the instance forces it (HUB_FEATURES_FORCE, `name` on, `-name` off); else the organization chose (table org_features); else the instance defaults it on (HUB_FEATURES_DEFAULT); else it is off.
Index ¶
Constants ¶
const ( // UIHX is the new interface; the old one stays until everything is switched over. UIHX = "ui.hx" // Env is the machines' environment screen. Env = "env" // Catalog is the catalog of tools and skills. Catalog = "catalog" // MachineResources is editing a machine's resources and showing their price. MachineResources = "machine.resources" // OrgEvents is the organization's live stream (GET /api/orgs/{org}/events). OrgEvents = "org.events" // UIHXLive is the lively hub: the common motion on every screen, free periods, sortable tables and the tools screen. UIHXLive = "ui.hx.live" // RuntimeFleet is one runtime for all of a person's machines: GET /api/me/machines and the /api/v2 proxy of the hub. RuntimeFleet = "runtime.fleet" // SecretsVault is the hub's safe: the machines of the organization keep their secrets on the hub's server // (HUB_SECRETS_VAULT_*, docs/safe.md). SecretsVault = "secrets.vault" // Efficiency is the «Эффективность» screen's figures: GET /api/orgs/{org}/efficiency/summary. Efficiency = "efficiency" // ChatResume is continuing a chat on another machine of the person while the one it ran on is off, from the resume // snapshot its machine left in the hub's store after each turn (docs/hub/resume.md). ChatResume = "chat.resume" // MachineSeats shows the machines of one server (one hostname in a tenant, a Linux user per person) as one server // with the people's seats in it; the server's load and hardware are counted once. MachineSeats = "machine.seats" // EnvPacks lets an organization put environment packs (tools, hooks, MCP and the safe's rules in a versioned // repository folder) in its catalog (docs/hub/packs.md). EnvPacks = "env.packs" // EnvOwn is a person's own layer of the environment: their own skills and MCP servers, and their switches, on their // own machines' lists (docs/hub/environment.md «Own layer»). EnvOwn = "env.own" // HooksNoSpool is an organization's policy to keep no webhook bodies in the hub: a managed webhook is passed to its // holder while it is online, and the sender gets 503 otherwise (docs/hub/sources.md «Вебхуки»). HooksNoSpool = "hooks.nospool" )
The flags the hub knows.
const CacheTTL = 5 * time.Second
CacheTTL is how long an organization's flags are kept before the table is read again; a change made by this process is seen at once, one made by another replica within this time.
Variables ¶
var Known = []string{UIHX, Env, Catalog, MachineResources, OrgEvents, UIHXLive, RuntimeFleet, SecretsVault, Efficiency, ChatResume, MachineSeats, EnvPacks, EnvOwn, HooksNoSpool}
Known are the flag names in the order they are shown.
Functions ¶
Types ¶
type Gate ¶
Gate answers whether a flag is on for an organization (its id, or `space:<id>` for a space that is in none).
type Static ¶
Static is a Gate with fixed flags, for tests of other packages: Static{"org": {"env": true}}.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the Gate over the org_features table.
func (*Store) Forced ¶
Forced says that the instance decides the flag, so an organization's choice changes nothing.
func (*Store) Instance ¶
Instance are the flags that are on for an organization that chose nothing: what the instance forces or defaults on.