Documentation
¶
Overview ¶
Package 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.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler( mounted *pluginruntime.Mounted, export string, want plugin.Contract, ) (http.Handler, error)
Handler returns an exact exported handler boundary from a mounted realm.
func RegisterRoutes ¶
func RegisterRoutes( mount pluginruntime.MountContext, contract plugin.Contract, routes []Route, ) error
RegisterRoutes registers routes and attaches their disposer to the plugin's lifecycle before returning.
Types ¶
type Registry ¶
Registry is the typed route extension point. Register atomically publishes all routes or none and returns an idempotent disposer scoped to their owner.
func LookupRegistry ¶
LookupRegistry resolves one exact route-registry dependency.
type RegistryHandler ¶
RegistryHandler 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.
type Route ¶
Route 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.
type RouterFactory ¶
type RouterFactory struct {
// contains filtered or unexported fields
}
RouterFactory provides a route registry and handler under caller-supplied exact contracts. The descriptor determines the realm and immutable identity.
func NewRouterFactory ¶
func NewRouterFactory( descriptor plugin.Descriptor, routesContract, handlerContract plugin.Contract, ) (*RouterFactory, error)
NewRouterFactory validates a complete router descriptor. It must provide exactly the two supplied contracts and must not require another service.
func (*RouterFactory) Descriptor ¶
func (factory *RouterFactory) Descriptor() plugin.Descriptor
func (*RouterFactory) Mount ¶
func (factory *RouterFactory) Mount(_ context.Context, mount pluginruntime.MountContext) error