Documentation
¶
Overview ¶
Package registry is the CLI's list of Norcube services, read from the embedded services.yaml. Endpoints, audiences, `nrc api` service names and code generation all come from here, so adding a service is one manifest entry plus its commands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Service ¶
type Service struct {
// Key names the service in config files, --endpoint-url and
// NORCUBE_<KEY>_URL. Stable: changing it breaks users' configs.
Key string `yaml:"key"`
// Name is the product name shown to people.
Name string `yaml:"name"`
// Command is the CLI command group and the service name `nrc api`
// accepts. Empty for services without commands (the web app).
Command string `yaml:"command"`
// Aliases are further names `nrc api` and the command group accept.
Aliases []string `yaml:"aliases"`
// Audience is the OAuth audience of the service's access tokens.
// Empty when the CLI never calls the service with a token.
Audience string `yaml:"audience"`
// Endpoint is the production base URL.
Endpoint string `yaml:"endpoint"`
// Spec locates the service's Swagger 2.0 file in the backend
// monorepo: apps/<app>/docs/<file>.
Spec *Spec `yaml:"spec"`
// Package is the generated client under internal/api/<package>;
// empty when no client is generated yet.
Package string `yaml:"package"`
}
Service is one entry of services.yaml.
func All ¶
func All() []Service
All returns the services in manifest order. The manifest is embedded and validated by tests, so an error here means a broken build; All panics instead of making every caller handle it.
func Callable ¶
func Callable() []Service
Callable returns the services `nrc api` can call: those with an audience and a command name, sorted by command.
Click to show internal directories.
Click to hide internal directories.