httpserver

package
v1.128.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2026 License: Apache-2.0 Imports: 86 Imported by: 0

Documentation

Overview

Package httpserver assembles the platform's HTTP surface: the mux and route table (MCP streamable HTTP, SSE, OAuth, admin/portal/resources/gateway/ observability REST APIs, portal UI), CORS, and the drain/shutdown sequencing that lets connected agents reconnect to a new build. main.go owns flag parsing, config load, platform construction, signal handling, and the run/shutdown loop; it hands a fully-constructed platform to Serve.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Serve

func Serve(ctx context.Context, mcpServer *mcp.Server, p *platform.Platform, address string) error

Serve assembles the full HTTP mux (MCP streamable HTTP + SSE, OAuth, admin/ portal/resources/gateway/observability REST APIs, portal UI, health) and blocks serving it on address until ctx is canceled, then drains gracefully. Gateway/api-gateway integrations (broadcaster, token stores, catalog store, embed-job queue) and the admin self-connection are wired by p.WireRuntime in the caller, which runs before this HTTP setup. That keeps their ordering in one place (#854): the SSE long-poll path still gets the broadcaster wired into the gateway toolkit before the listener comes up at the end of this function, so AwareHandler never accepts a subscriber ahead of the wiring.

Types

type TableSourceHooks added in v1.126.5

type TableSourceHooks struct {
	AssetDeleted    func(context.Context, string)
	ResourceDeleted func(context.Context, string)
	AssetRevised    func(ctx context.Context, id string, version int) []string
	ResourceRevised func(ctx context.Context, id string, version int) []string
}

TableSourceHooks are the callbacks the surrounding surfaces install at the two moments a source changes under its tables: a delete, so a deleted file leaves no table behind, and a revision, so a following registration moves onto the new head and a pinned one is reported behind (#1536). Every field is nil on a deployment that cannot register.

A revise hook returns what happened to each registration over the file, as the sentences the write's result carries, and never fails the write.

Directories

Path Synopsis
Package accessgate refuses portal requests from callers whose roles map to no persona.
Package accessgate refuses portal requests from callers whose roles map to no persona.
Package apishttp serves /api/v1/apis: the read surface that answers, for one caller, which api-kind connections they reach and what operations each one exposes.
Package apishttp serves /api/v1/apis: the read surface that answers, for one caller, which api-kind connections they reach and what operations each one exposes.
Package apiwire composes the operation browser's read surface from the registries a deployment holds: which connections a caller reaches, which toolkit answers for one, and how a caller's identity reaches the route policy.
Package apiwire composes the operation browser's read surface from the registries a deployment holds: which connections a caller reaches, which toolkit answers for one, and how a caller's identity reaches the route policy.
Package attachhttp exposes prompt resource attachments (#1013) over REST for both operator surfaces: the portal (a prompt author manages the materials on their own prompts) and the admin API (any prompt).
Package attachhttp exposes prompt resource attachments (#1013) over REST for both operator surfaces: the portal (a prompt author manages the materials on their own prompts) and the admin API (any prompt).
Package datahubapi serves the portal's DataHub Catalog and Context Docs REST surface (#718): browse/search/read over DataHub connections plus catalog metadata edits and context-document CRUD, gated per-persona.
Package datahubapi serves the portal's DataHub Catalog and Context Docs REST surface (#718): browse/search/read over DataHub connections plus catalog metadata edits and context-document CRUD, gated per-persona.
Package gatewayhttp exposes the apigateway toolkit's invoke operation over plain REST so non-MCP HTTP clients (e.g.
Package gatewayhttp exposes the apigateway toolkit's invoke operation over plain REST so non-MCP HTTP clients (e.g.
Package health provides readiness state tracking and HTTP health check handlers.
Package health provides readiness state tracking and HTTP health check handlers.
Package httpauth is the HTTP-level authentication gate for the MCP transports: it extracts a bearer token or API key from the request, authenticates it, and refuses an unauthenticated caller with the challenge the transport expects before any MCP framing is parsed.
Package httpauth is the HTTP-level authentication gate for the MCP transports: it extracts a bearer token or API key from the request, authenticates it, and refuses an unauthenticated caller with the challenge the transport expects before any MCP framing is parsed.
Package mentionhttp serves the people surfaces of the portal API: the known-users directory behind the share picker (#614), the audience-scoped candidate list behind the @-mention picker, and the caller's mentions inbox (#627).
Package mentionhttp serves the people surfaces of the portal API: the known-users directory behind the share picker (#614), the audience-scoped candidate list behind the @-mention picker, and the caller's mentions inbox (#627).
Package notifyhttp serves the self-scoped notification-preference REST endpoints the portal settings page calls.
Package notifyhttp serves the self-scoped notification-preference REST endpoints the portal settings page calls.
Package scripthttp exposes managed scripts over the admin REST API — the script list, a script's version history, one version with what its code reaches for, schedules, and the run history — and the portal's own script routes.
Package scripthttp exposes managed scripts over the admin REST API — the script list, a script's version history, one version with what its code reaches for, schedules, and the run history — and the portal's own script routes.
Package sources provides concrete enrichment Source adapters for the platform's built-in toolkits (Trino, DataHub).
Package sources provides concrete enrichment Source adapters for the platform's built-in toolkits (Trino, DataHub).
Package tablehttp serves the register / unregister actions that make an uploaded file readable as a query-engine table (#1327).
Package tablehttp serves the register / unregister actions that make an uploaded file readable as a query-engine table (#1327).
Package tablesource is the registrar's view of the two kinds of stored file a table is built over: how a managed resource and a portal asset are resolved into a tableregister.Source, and under which rule.
Package tablesource is the registrar's view of the two kinds of stored file a table is built over: how a managed resource and a portal asset are resolved into a tableregister.Source, and under which rule.
Package unsubhttp serves the no-login unsubscribe endpoint linked from every notification email footer and named by the RFC 8058 List-Unsubscribe header.
Package unsubhttp serves the no-login unsubscribe endpoint linked from every notification email footer and named by the RFC 8058 List-Unsubscribe header.
Package versionhttp exposes prompt version history, draft review actions, audit-derived usage stats (#1009), and prompt collection management (#1010) over REST.
Package versionhttp exposes prompt version history, draft review actions, audit-derived usage stats (#1009), and prompt collection management (#1010) over REST.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL