{"modulePath":"github.com/bojieli/OpenRealtime","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package httpservice\n\nPackage httpservice provides realm-neutral, scoped HTTP routing mechanics for plugin compositions. It deliberately knows no product routes, tokens, or payload schemas; those remain behavior owned by server or presentation plugins.\n\n## Functions\n\n```go\nfunc Handler(\n\tmounted *pluginruntime.Mounted, export string, want plugin.Contract,\n) (http.Handler, error)\n```\nHandler returns an exact exported handler boundary from a mounted realm.\n\n```go\nfunc RegisterRoutes(\n\tmount pluginruntime.MountContext, contract plugin.Contract, routes []Route,\n) error\n```\nRegisterRoutes registers routes and attaches their disposer to the plugin's lifecycle before returning.\n\n## Types\n\n```go\ntype Registry interface {\n\tRegister(owner string, routes []Route) (dispose func(), err error)\n}\n```\nRegistry is the typed route extension point. Register atomically publishes all routes or none and returns an idempotent disposer scoped to their owner.\n\n```go\nfunc LookupRegistry(\n\tservices pluginruntime.Services, contract plugin.Contract,\n) (Registry, error)\n```\nLookupRegistry resolves one exact route-registry dependency.\n\n```go\ntype RegistryHandler interface {\n\tRegistry\n\thttp.Handler\n}\n```\nRegistryHandler is the complete in-memory router mechanic. Applications normally consume it through plugin services; the constructor is exposed for focused conformance and benchmarks of route publication itself.\n\n```go\nfunc NewRouter() RegistryHandler\n```\nNewRouter returns an empty atomic router.\n\n```go\ntype Route struct {\n\tPattern string\n\tHandler http.Handler\n}\n```\nRoute is one standard-library HTTP mux pattern and handler. Patterns carry their method (for example, \"GET /client/v1/manifest\") so method admission is owned by the registering plugin instead of a shared catch-all.\n\n```go\ntype RouterFactory struct {\n\t// contains filtered or unexported fields\n}\n```\nRouterFactory provides a route registry and handler under caller-supplied exact contracts. The descriptor determines the realm and immutable identity.\n\n```go\nfunc NewRouterFactory(\n\tdescriptor plugin.Descriptor, routesContract, handlerContract plugin.Contract,\n) (*RouterFactory, error)\n```\nNewRouterFactory validates a complete router descriptor. It must provide exactly the two supplied contracts and must not require another service.\n\n```go\nfunc (factory *RouterFactory) Descriptor() plugin.Descriptor\n```\n\n```go\nfunc (factory *RouterFactory) Mount(_ context.Context, mount pluginruntime.MountContext) error\n```\n\n","path":"github.com/bojieli/OpenRealtime/plugin/httpservice","name":"httpservice","synopsis":"Package httpservice provides realm-neutral, scoped HTTP routing mechanics for plugin compositions.","isRedistributable":true}
