{"modulePath":"github.com/txn2/mcp-data-platform","version":"v1.167.0","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpserver\n\nPackage 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.\n\n## Functions\n\n```go\nfunc AdminHandler(p *platform.Platform, notify *notifydelivery.Handle) http.Handler\n```\nAdminHandler constructs the admin REST API handler from the platform: the one assembly of admin.Deps, mounted by Serve and built by the E2E suite (#2037), so a dependency the admin routes gain reaches both. notify may be nil, which leaves the notification routes unregistered.\n\n```go\nfunc Serve(ctx context.Context, mcpServer *mcp.Server, p *platform.Platform, address string) error\n```\nServe 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.\n\n## Types\n\n```go\ntype TableSourceHooks struct {\n\tAssetDeleted    func(context.Context, string)\n\tResourceDeleted func(context.Context, string)\n\tAssetRevised    func(ctx context.Context, id string, version int) []string\n\tResourceRevised func(ctx context.Context, id string, version int) []string\n}\n```\nTableSourceHooks 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.\n\nA revise hook returns what happened to each registration over the file, as the sentences the write's result carries, and never fails the write.\n\n","path":"github.com/txn2/mcp-data-platform/internal/httpserver","name":"httpserver","synopsis":"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.","isRedistributable":true}
