Documentation
¶
Overview ¶
Package api assembles and runs the `jentic` command tree — the API-spec surface (register/identity, context/env, catalog, apis, search, inspect, execute) for discovering, inspecting, and executing against the Jentic API catalog. Data-plane commands speak to the control plane through the generated SDK (client/generated/control); `jentic migrate` is the sole reader of the legacy V1 store (see legacy_store.go).
Index ¶
Constants ¶
const PositionalArg = "<arg>"
PositionalArg is the CuratedBinding.Bind value for a spec field satisfied by a positional argument rather than a flag.
Variables ¶
This section is empty.
Functions ¶
func ExecuteAPI ¶
func ExecuteAPI()
ExecuteAPI runs the jentic (API-spec) command tree and exits with an appropriate status code.
func NewDocsRoot ¶
NewDocsRoot builds the assembled `jentic` root with a throwaway App for documentation generation. No filesystem or network access happens at construction time — commands only act when run — so a zero App is safe.
func TreeBuilder ¶
func TreeBuilder() core.TreeBuilder
TreeBuilder exposes the built-in `jentic` (API) command tree as a core.TreeBuilder so a downstream module can compose it via core.NewRootCmd(deps, api.TreeBuilder()). cli/pkg/clitree re-exports it so other modules can import it (internal/ is not importable cross-module).
Types ¶
type CuratedBinding ¶
type CuratedBinding struct {
// Command is the space-separated path under the `jentic` root, e.g.
// "history export".
Command string
// Params is the zero value of the generated request params/body struct the
// command constructs.
Params any
// Bind maps a json field name to the flag that populates it (or
// PositionalArg when a positional argument does).
Bind map[string]string
// NotExposed maps a json field name to the one-line reviewed reason it has
// no flag. `jentic api <op>` still reaches every one of these.
NotExposed map[string]string
}
CuratedBinding declares, for ONE curated command, how the exported fields of its generated request params/body struct surface on the CLI. It is the registry Test1G_SpecFlagCoverageParity (impl/0.0 §1G) reflects over: every json field of Params must appear in exactly one of Bind or NotExposed, every Bind flag must exist on the command, and neither map may name a field the struct no longer has. The payoff: `make generate-api` after a spec addition makes 1G fail until a human classifies the new field — bind it or record why not — so a curated command can never silently lag its spec (GEN-1).
func CuratedBindings ¶
func CuratedBindings() []CuratedBinding
CuratedBindings returns the registry of curated commands that construct generated request structs. Commands living entirely on internal/apiclient (search, apis list/show, execute) have no generated struct to drift from and are not listed; they migrate in here as they move onto the generated SDK.
type HTTPError ¶
HTTPError is a non-2xx control-plane response. It mirrors the shape the hand-written httpx.HTTPError offered — StatusCode plus the raw problem-details body — so existing error-mapping logic ports unchanged. (Named HTTPError, not APIError, so it does not stutter as api.APIError — revive `exported`.)
Source Files
¶
- access.go
- access_plan.go
- access_print.go
- access_run.go
- admin.go
- admin_providers.go
- api.go
- apis.go
- apis_client.go
- apis_import.go
- apis_print.go
- apis_tui.go
- app.go
- args.go
- catalog.go
- catalog_client.go
- catalog_print.go
- catalog_tui.go
- context.go
- credentials.go
- curated.go
- delete_cmd.go
- doctor.go
- endpoints.go
- env.go
- errors.go
- events.go
- execute.go
- execute_broker.go
- execute_directive.go
- execute_print.go
- fencing.go
- history.go
- identity.go
- identity_claim.go
- inspect.go
- legacy_store.go
- logout.go
- migrate.go
- plan.go
- reset.go
- reset_account.go
- reset_identity.go
- root.go
- search.go
- session.go
- theme.go
- tui.go